Mercurial > lada > lada-client
annotate app/controller/grid/Messung.js @ 600:339741bc6ebf
Removed row editing plugin in ort grid.
author | Raimund Renkert <raimund.renkert@intevation.de> |
---|---|
date | Thu, 12 Mar 2015 15:48:34 +0100 |
parents | 825973ca386f |
children | ee92e352be20 |
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({ |
592
825973ca386f
Updated missing name changes for messung grid.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
591
diff
changeset
|
21 'messunggrid': { |
588
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 }, |
592
825973ca386f
Updated missing name changes for messung grid.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
591
diff
changeset
|
24 'messunggrid button[action=add]': { |
588
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 }, |
592
825973ca386f
Updated missing name changes for messung grid.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
591
diff
changeset
|
27 'messunggrid button[action=delete]': { |
588
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 var win = Ext.create('Lada.view.window.MessungEdit', { |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
35 record: record |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
36 }); |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
37 win.show(); |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
38 win.initData(); |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
39 }, |
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 add: function() { |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
42 // TODO |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
43 console.log('add'); |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
44 }, |
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 remove: function(button) { |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
47 var grid = button.up('grid'); |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
48 var selection = grid.getView().getSelectionModel().getSelection()[0]; |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
49 Ext.MessageBox.confirm( |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
50 'Messung löschen', |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
51 'Sind Sie sicher?', |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
52 function(btn) { |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
53 if (btn === 'yes') { |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
54 selection.destroy({ |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
55 success: function() { |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
56 button.up('window').initData(); |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
57 }, |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
58 failure: function() { |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
59 } |
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 }); |