Mercurial > lada > lada-client
annotate app/controller/grid/Messung.js @ 588:e24bc8cf8e1d
Renamed messungen grid and controller.
author | Raimund Renkert <raimund.renkert@intevation.de> |
---|---|
date | Wed, 11 Mar 2015 15:21:27 +0100 |
parents | |
children | f2742f9b5a64 |
rev | line source |
---|---|
588
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
1 /* Copyright (C) 2013 by Bundesamt fuer Strahlenschutz |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
2 * Software engineering by Intevation GmbH |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
3 * |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
4 * This file is Free Software under the GNU GPL (v>=3) |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
5 * and comes with ABSOLUTELY NO WARRANTY! Check out |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
6 * the documentation coming with IMIS-Labordaten-Application for details. |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
7 */ |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
8 |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
9 /* |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
10 * Controller for a Messungengrid |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
11 */ |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
12 Ext.define('Lada.controller.grid.Messung', { |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
13 extend: 'Ext.app.Controller', |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
14 |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
15 requires: [ |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
16 'Lada.view.window.MessungEdit' |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
17 ], |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
18 |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
19 init: function() { |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
20 this.control({ |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
21 'messungengrid': { |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
22 itemdblclick: this.editItem |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
23 }, |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
24 'messungengrid button[action=add]': { |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
25 click: this.add |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
26 }, |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
27 'messungengrid button[action=delete]': { |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
28 click: this.remove |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
29 } |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
30 }); |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
31 }, |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
32 |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
33 editItem: function(grid, record) { |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
34 console.log(record); |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
35 var win = Ext.create('Lada.view.window.MessungEdit', { |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
36 record: record |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
37 }); |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
38 win.show(); |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
39 win.initData(); |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
40 }, |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
41 |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
42 add: function() { |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
43 // TODO |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
44 console.log('add'); |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
45 }, |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
46 |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
47 remove: function(button) { |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
48 var grid = button.up('grid'); |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
49 var selection = grid.getView().getSelectionModel().getSelection()[0]; |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
50 Ext.MessageBox.confirm( |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
51 'Messung löschen', |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
52 'Sind Sie sicher?', |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
53 function(btn) { |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
54 if (btn === 'yes') { |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
55 selection.destroy({ |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
56 success: function() { |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
57 button.up('window').initData(); |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
58 }, |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
59 failure: function() { |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
60 } |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
61 }); |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
62 } |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
63 }); |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
64 } |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
65 }); |