Mercurial > lada > lada-client
annotate app/controller/grid/Messung.js @ 1323:754db8d73691
merged
author | Raimund Renkert <raimund.renkert@intevation.de> |
---|---|
date | Fri, 03 Feb 2017 14:32:28 +0100 |
parents | d7bcd31ceaa6 |
children | 41b894caacfe |
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 |
742
6e28ebbe1a73
added documentation for Form and Grid controllers
Dustin Demuth <dustin@intevation.de>
parents:
705
diff
changeset
|
19 /** |
6e28ebbe1a73
added documentation for Form and Grid controllers
Dustin Demuth <dustin@intevation.de>
parents:
705
diff
changeset
|
20 * Inhitialize the controller |
6e28ebbe1a73
added documentation for Form and Grid controllers
Dustin Demuth <dustin@intevation.de>
parents:
705
diff
changeset
|
21 * It has 3 listeners |
6e28ebbe1a73
added documentation for Form and Grid controllers
Dustin Demuth <dustin@intevation.de>
parents:
705
diff
changeset
|
22 */ |
588
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
23 init: function() { |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
24 this.control({ |
592
825973ca386f
Updated missing name changes for messung grid.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
591
diff
changeset
|
25 'messunggrid': { |
588
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
26 itemdblclick: this.editItem |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
27 }, |
592
825973ca386f
Updated missing name changes for messung grid.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
591
diff
changeset
|
28 'messunggrid button[action=add]': { |
588
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
29 click: this.add |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
30 }, |
592
825973ca386f
Updated missing name changes for messung grid.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
591
diff
changeset
|
31 'messunggrid button[action=delete]': { |
588
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
32 click: this.remove |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
33 } |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
34 }); |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
35 }, |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
36 |
742
6e28ebbe1a73
added documentation for Form and Grid controllers
Dustin Demuth <dustin@intevation.de>
parents:
705
diff
changeset
|
37 /** |
6e28ebbe1a73
added documentation for Form and Grid controllers
Dustin Demuth <dustin@intevation.de>
parents:
705
diff
changeset
|
38 * This function opens a new {@link Lada.view.window.MessungEdit} |
6e28ebbe1a73
added documentation for Form and Grid controllers
Dustin Demuth <dustin@intevation.de>
parents:
705
diff
changeset
|
39 * Window. |
6e28ebbe1a73
added documentation for Form and Grid controllers
Dustin Demuth <dustin@intevation.de>
parents:
705
diff
changeset
|
40 */ |
588
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
41 editItem: function(grid, record) { |
1111
a73726bba79c
Use custom row expander in probe list grid to display messung grid.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
963
diff
changeset
|
42 // we have a window with a probe record! |
a73726bba79c
Use custom row expander in probe list grid to display messung grid.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
963
diff
changeset
|
43 if (grid.up('window')) { |
a73726bba79c
Use custom row expander in probe list grid to display messung grid.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
963
diff
changeset
|
44 var probe = grid.up('window').record; |
a73726bba79c
Use custom row expander in probe list grid to display messung grid.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
963
diff
changeset
|
45 /* Only open a new Window when: |
a73726bba79c
Use custom row expander in probe list grid to display messung grid.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
963
diff
changeset
|
46 statusEdit = True |
a73726bba79c
Use custom row expander in probe list grid to display messung grid.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
963
diff
changeset
|
47 -or- |
a73726bba79c
Use custom row expander in probe list grid to display messung grid.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
963
diff
changeset
|
48 the value of status is not 0 |
a73726bba79c
Use custom row expander in probe list grid to display messung grid.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
963
diff
changeset
|
49 -or- |
a73726bba79c
Use custom row expander in probe list grid to display messung grid.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
963
diff
changeset
|
50 the owner = True |
963
6a6f2c6fe8ee
More work done on StatusWerte and Statusstufe. A Messung will also open when the owner attribute is true. Stauswerte and StatusStufen are loaded at application startup. Statusgrid and Messunggrid now use these stores, which were registered at the store manager.
Dustin Demuth <dustin@intevation.de>
parents:
962
diff
changeset
|
51 |
1111
a73726bba79c
Use custom row expander in probe list grid to display messung grid.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
963
diff
changeset
|
52 the statusWert attribute is not present in the original data. |
a73726bba79c
Use custom row expander in probe list grid to display messung grid.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
963
diff
changeset
|
53 it is appended, when the value and name of the status were |
a73726bba79c
Use custom row expander in probe list grid to display messung grid.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
963
diff
changeset
|
54 determined. |
a73726bba79c
Use custom row expander in probe list grid to display messung grid.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
963
diff
changeset
|
55 */ |
a73726bba79c
Use custom row expander in probe list grid to display messung grid.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
963
diff
changeset
|
56 if (record.get('statusEdit') |
a73726bba79c
Use custom row expander in probe list grid to display messung grid.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
963
diff
changeset
|
57 || record.get('statusWert') > 0 |
a73726bba79c
Use custom row expander in probe list grid to display messung grid.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
963
diff
changeset
|
58 || record.get('owner')) { |
a73726bba79c
Use custom row expander in probe list grid to display messung grid.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
963
diff
changeset
|
59 var win = Ext.create('Lada.view.window.MessungEdit', { |
a73726bba79c
Use custom row expander in probe list grid to display messung grid.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
963
diff
changeset
|
60 parentWindow: grid.up('window'), |
a73726bba79c
Use custom row expander in probe list grid to display messung grid.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
963
diff
changeset
|
61 probe: probe, |
a73726bba79c
Use custom row expander in probe list grid to display messung grid.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
963
diff
changeset
|
62 record: record, |
a73726bba79c
Use custom row expander in probe list grid to display messung grid.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
963
diff
changeset
|
63 grid: grid |
a73726bba79c
Use custom row expander in probe list grid to display messung grid.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
963
diff
changeset
|
64 }); |
a73726bba79c
Use custom row expander in probe list grid to display messung grid.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
963
diff
changeset
|
65 win.show(); |
1164
f43635937581
Open Probe always on the left side of the window and Messung on the right side
Evi Huber <ehuber@bfs.de>
parents:
1120
diff
changeset
|
66 win.setPosition(window.innerWidth - 30 -win.width); |
1111
a73726bba79c
Use custom row expander in probe list grid to display messung grid.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
963
diff
changeset
|
67 win.initData(); |
a73726bba79c
Use custom row expander in probe list grid to display messung grid.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
963
diff
changeset
|
68 } |
a73726bba79c
Use custom row expander in probe list grid to display messung grid.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
963
diff
changeset
|
69 return; |
962
9b6800458a9e
Altered permissions to open a Messung from the Messung-grid. Opening a Messung is only possible, when: a) StatusEdit=True or b) StatusWert > 0
Dustin Demuth <dustin@intevation.de>
parents:
826
diff
changeset
|
70 } |
1111
a73726bba79c
Use custom row expander in probe list grid to display messung grid.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
963
diff
changeset
|
71 var probeRecord = Ext.create('Lada.model.ProbeList'); |
a73726bba79c
Use custom row expander in probe list grid to display messung grid.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
963
diff
changeset
|
72 probeRecord.setId(record.get('probeId')); |
a73726bba79c
Use custom row expander in probe list grid to display messung grid.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
963
diff
changeset
|
73 probeRecord.set('owner', record.get('owner')); |
a73726bba79c
Use custom row expander in probe list grid to display messung grid.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
963
diff
changeset
|
74 probeRecord.set('readonly', record.get('readonly')); |
a73726bba79c
Use custom row expander in probe list grid to display messung grid.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
963
diff
changeset
|
75 |
a73726bba79c
Use custom row expander in probe list grid to display messung grid.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
963
diff
changeset
|
76 var probeWin = Ext.create('Lada.view.window.ProbeEdit', { |
a73726bba79c
Use custom row expander in probe list grid to display messung grid.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
963
diff
changeset
|
77 record: probeRecord, |
a73726bba79c
Use custom row expander in probe list grid to display messung grid.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
963
diff
changeset
|
78 style: 'z-index: -1;' //Fixes an Issue where windows could not be created in IE8 |
a73726bba79c
Use custom row expander in probe list grid to display messung grid.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
963
diff
changeset
|
79 }); |
a73726bba79c
Use custom row expander in probe list grid to display messung grid.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
963
diff
changeset
|
80 |
a73726bba79c
Use custom row expander in probe list grid to display messung grid.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
963
diff
changeset
|
81 probeWin.setPosition(30); |
a73726bba79c
Use custom row expander in probe list grid to display messung grid.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
963
diff
changeset
|
82 probeWin.show(); |
a73726bba79c
Use custom row expander in probe list grid to display messung grid.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
963
diff
changeset
|
83 probeWin.initData(); |
a73726bba79c
Use custom row expander in probe list grid to display messung grid.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
963
diff
changeset
|
84 |
a73726bba79c
Use custom row expander in probe list grid to display messung grid.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
963
diff
changeset
|
85 Ext.ClassManager.get('Lada.model.Probe').load(record.get('probeId'), { |
a73726bba79c
Use custom row expander in probe list grid to display messung grid.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
963
diff
changeset
|
86 failure: function(record, action) { |
a73726bba79c
Use custom row expander in probe list grid to display messung grid.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
963
diff
changeset
|
87 me.setLoading(false); |
a73726bba79c
Use custom row expander in probe list grid to display messung grid.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
963
diff
changeset
|
88 // TODO |
a73726bba79c
Use custom row expander in probe list grid to display messung grid.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
963
diff
changeset
|
89 console.log('An unhandled Failure occured. See following Response and Record'); |
a73726bba79c
Use custom row expander in probe list grid to display messung grid.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
963
diff
changeset
|
90 console.log(action); |
a73726bba79c
Use custom row expander in probe list grid to display messung grid.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
963
diff
changeset
|
91 console.log(record); |
a73726bba79c
Use custom row expander in probe list grid to display messung grid.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
963
diff
changeset
|
92 }, |
a73726bba79c
Use custom row expander in probe list grid to display messung grid.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
963
diff
changeset
|
93 success: function(precord, response) { |
a73726bba79c
Use custom row expander in probe list grid to display messung grid.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
963
diff
changeset
|
94 var messungWin = Ext.create('Lada.view.window.MessungEdit', { |
1120
0a032c98c3a6
Use correct parent window reference for messung windows.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1111
diff
changeset
|
95 parentWindow: probeWin, |
1111
a73726bba79c
Use custom row expander in probe list grid to display messung grid.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
963
diff
changeset
|
96 probe: precord, |
a73726bba79c
Use custom row expander in probe list grid to display messung grid.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
963
diff
changeset
|
97 record: record, |
a73726bba79c
Use custom row expander in probe list grid to display messung grid.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
963
diff
changeset
|
98 grid: grid |
a73726bba79c
Use custom row expander in probe list grid to display messung grid.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
963
diff
changeset
|
99 }); |
a73726bba79c
Use custom row expander in probe list grid to display messung grid.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
963
diff
changeset
|
100 messungWin.show(); |
a73726bba79c
Use custom row expander in probe list grid to display messung grid.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
963
diff
changeset
|
101 messungWin.setPosition(window.innerWidth - 30 - messungWin.width); |
a73726bba79c
Use custom row expander in probe list grid to display messung grid.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
963
diff
changeset
|
102 messungWin.initData(); |
a73726bba79c
Use custom row expander in probe list grid to display messung grid.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
963
diff
changeset
|
103 } |
a73726bba79c
Use custom row expander in probe list grid to display messung grid.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
963
diff
changeset
|
104 }); |
588
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
105 }, |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
106 |
742
6e28ebbe1a73
added documentation for Form and Grid controllers
Dustin Demuth <dustin@intevation.de>
parents:
705
diff
changeset
|
107 /** |
6e28ebbe1a73
added documentation for Form and Grid controllers
Dustin Demuth <dustin@intevation.de>
parents:
705
diff
changeset
|
108 * This function opens a window add a Messung |
6e28ebbe1a73
added documentation for Form and Grid controllers
Dustin Demuth <dustin@intevation.de>
parents:
705
diff
changeset
|
109 */ |
622
ee92e352be20
Open messung create window on button click.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
592
diff
changeset
|
110 add: function(button) { |
ee92e352be20
Open messung create window on button click.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
592
diff
changeset
|
111 var probe = button.up('window').record; |
ee92e352be20
Open messung create window on button click.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
592
diff
changeset
|
112 var win = Ext.create('Lada.view.window.MessungCreate', { |
644
71e8b84d7829
Reload grids on messung or ort changed/added.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
622
diff
changeset
|
113 record: probe, |
1190
d7bcd31ceaa6
Added reference to probe window when opening messung create window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1164
diff
changeset
|
114 grid: button.up('messunggrid'), |
d7bcd31ceaa6
Added reference to probe window when opening messung create window.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1164
diff
changeset
|
115 parentWindow: button.up('window') |
622
ee92e352be20
Open messung create window on button click.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
592
diff
changeset
|
116 }); |
ee92e352be20
Open messung create window on button click.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
592
diff
changeset
|
117 win.show(); |
ee92e352be20
Open messung create window on button click.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
592
diff
changeset
|
118 win.initData(); |
588
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
119 }, |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
120 |
742
6e28ebbe1a73
added documentation for Form and Grid controllers
Dustin Demuth <dustin@intevation.de>
parents:
705
diff
changeset
|
121 /** |
6e28ebbe1a73
added documentation for Form and Grid controllers
Dustin Demuth <dustin@intevation.de>
parents:
705
diff
changeset
|
122 * This function removes a Messung |
6e28ebbe1a73
added documentation for Form and Grid controllers
Dustin Demuth <dustin@intevation.de>
parents:
705
diff
changeset
|
123 * It displays a Confirmation-Popup. |
6e28ebbe1a73
added documentation for Form and Grid controllers
Dustin Demuth <dustin@intevation.de>
parents:
705
diff
changeset
|
124 * When the Removal was confirmed and the operation was successful, |
6e28ebbe1a73
added documentation for Form and Grid controllers
Dustin Demuth <dustin@intevation.de>
parents:
705
diff
changeset
|
125 * the Messung-row is removed from the grid. |
6e28ebbe1a73
added documentation for Form and Grid controllers
Dustin Demuth <dustin@intevation.de>
parents:
705
diff
changeset
|
126 * On failure an Errormessage is shown |
6e28ebbe1a73
added documentation for Form and Grid controllers
Dustin Demuth <dustin@intevation.de>
parents:
705
diff
changeset
|
127 */ |
588
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
128 remove: function(button) { |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
129 var grid = button.up('grid'); |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
130 var selection = grid.getView().getSelectionModel().getSelection()[0]; |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
131 Ext.MessageBox.confirm( |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
132 'Messung löschen', |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
133 'Sind Sie sicher?', |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
134 function(btn) { |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
135 if (btn === 'yes') { |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
136 selection.destroy({ |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
137 success: function() { |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
138 button.up('window').initData(); |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
139 }, |
705
cc9107d9be17
ResponseObject was not defined
Dustin Demuth <dustin@intevation.de>
parents:
704
diff
changeset
|
140 failure: function(request, response) { |
704
2d454bfef426
Further Failure Messages
Dustin Demuth <dustin@intevation.de>
parents:
690
diff
changeset
|
141 var json = response.request.scope.reader.jsonData; |
2d454bfef426
Further Failure Messages
Dustin Demuth <dustin@intevation.de>
parents:
690
diff
changeset
|
142 if (json) { |
2d454bfef426
Further Failure Messages
Dustin Demuth <dustin@intevation.de>
parents:
690
diff
changeset
|
143 if (json.message){ |
2d454bfef426
Further Failure Messages
Dustin Demuth <dustin@intevation.de>
parents:
690
diff
changeset
|
144 Ext.Msg.alert(Lada.getApplication().bundle.getMsg('err.msg.delete.title') |
2d454bfef426
Further Failure Messages
Dustin Demuth <dustin@intevation.de>
parents:
690
diff
changeset
|
145 +' #'+json.message, |
2d454bfef426
Further Failure Messages
Dustin Demuth <dustin@intevation.de>
parents:
690
diff
changeset
|
146 Lada.getApplication().bundle.getMsg(json.message)); |
2d454bfef426
Further Failure Messages
Dustin Demuth <dustin@intevation.de>
parents:
690
diff
changeset
|
147 } else { |
2d454bfef426
Further Failure Messages
Dustin Demuth <dustin@intevation.de>
parents:
690
diff
changeset
|
148 Ext.Msg.alert(Lada.getApplication().bundle.getMsg('err.msg.delete.title'), |
2d454bfef426
Further Failure Messages
Dustin Demuth <dustin@intevation.de>
parents:
690
diff
changeset
|
149 Lada.getApplication().bundle.getMsg('err.msg.generic.body')); |
2d454bfef426
Further Failure Messages
Dustin Demuth <dustin@intevation.de>
parents:
690
diff
changeset
|
150 } |
2d454bfef426
Further Failure Messages
Dustin Demuth <dustin@intevation.de>
parents:
690
diff
changeset
|
151 } else { |
2d454bfef426
Further Failure Messages
Dustin Demuth <dustin@intevation.de>
parents:
690
diff
changeset
|
152 Ext.Msg.alert(Lada.getApplication().bundle.getMsg('err.msg.delete.title'), |
2d454bfef426
Further Failure Messages
Dustin Demuth <dustin@intevation.de>
parents:
690
diff
changeset
|
153 Lada.getApplication().bundle.getMsg('err.msg.response.body')); |
2d454bfef426
Further Failure Messages
Dustin Demuth <dustin@intevation.de>
parents:
690
diff
changeset
|
154 } |
588
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
155 } |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
156 }); |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
157 } |
622
ee92e352be20
Open messung create window on button click.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
592
diff
changeset
|
158 } |
ee92e352be20
Open messung create window on button click.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
592
diff
changeset
|
159 ); |
826
2362f8ab1e9f
disable remove button after a item is deleted from grid
Dustin Demuth <dustin@intevation.de>
parents:
742
diff
changeset
|
160 grid.down('button[action=delete]').disable(); |
588
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
161 } |
e24bc8cf8e1d
Renamed messungen grid and controller.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
162 }); |