Mercurial > lada > lada-client
annotate app/controller/grid/Probenehmer.js @ 1054:7e801af49eeb
Use exponential notation for messwerte and zusatzwerte.
author | Raimund Renkert <raimund.renkert@intevation.de> |
---|---|
date | Wed, 02 Mar 2016 12:59:15 +0100 |
parents | 77e22ad5cc84 |
children | fa422d69940c |
rev | line source |
---|---|
984
b21421ba6917
added buttons for datensatzerzeuger, pobenehmer, added controllers
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
1 /* Copyright (C) 2013 by Bundesamt fuer Strahlenschutz |
b21421ba6917
added buttons for datensatzerzeuger, pobenehmer, added controllers
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
2 * Software engineering by Intevation GmbH |
b21421ba6917
added buttons for datensatzerzeuger, pobenehmer, added controllers
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
3 * |
b21421ba6917
added buttons for datensatzerzeuger, pobenehmer, added controllers
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
4 * This file is Free Software under the GNU GPL (v>=3) |
b21421ba6917
added buttons for datensatzerzeuger, pobenehmer, added controllers
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
5 * and comes with ABSOLUTELY NO WARRANTY! Check out |
b21421ba6917
added buttons for datensatzerzeuger, pobenehmer, added controllers
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
6 * the documentation coming with IMIS-Labordaten-Application for details. |
b21421ba6917
added buttons for datensatzerzeuger, pobenehmer, added controllers
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
7 */ |
b21421ba6917
added buttons for datensatzerzeuger, pobenehmer, added controllers
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
8 |
b21421ba6917
added buttons for datensatzerzeuger, pobenehmer, added controllers
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
9 /** |
b21421ba6917
added buttons for datensatzerzeuger, pobenehmer, added controllers
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
10 * This is a controller for a grid of Probenehmer Stammdaten |
b21421ba6917
added buttons for datensatzerzeuger, pobenehmer, added controllers
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
11 */ |
b21421ba6917
added buttons for datensatzerzeuger, pobenehmer, added controllers
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
12 Ext.define('Lada.controller.grid.Probenehmer', { |
b21421ba6917
added buttons for datensatzerzeuger, pobenehmer, added controllers
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
13 extend: 'Ext.app.Controller', |
b21421ba6917
added buttons for datensatzerzeuger, pobenehmer, added controllers
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
14 |
b21421ba6917
added buttons for datensatzerzeuger, pobenehmer, added controllers
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
15 /** |
b21421ba6917
added buttons for datensatzerzeuger, pobenehmer, added controllers
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
16 * Inhitialize the controller |
b21421ba6917
added buttons for datensatzerzeuger, pobenehmer, added controllers
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
17 * It has 3 listeners |
b21421ba6917
added buttons for datensatzerzeuger, pobenehmer, added controllers
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
18 */ |
b21421ba6917
added buttons for datensatzerzeuger, pobenehmer, added controllers
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
19 init: function() { |
b21421ba6917
added buttons for datensatzerzeuger, pobenehmer, added controllers
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
20 this.control({ |
b21421ba6917
added buttons for datensatzerzeuger, pobenehmer, added controllers
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
21 'probenehmergrid': { |
b21421ba6917
added buttons for datensatzerzeuger, pobenehmer, added controllers
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
22 edit: this.gridSave, |
b21421ba6917
added buttons for datensatzerzeuger, pobenehmer, added controllers
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
23 canceledit: this.cancelEdit, |
1039
77e22ad5cc84
Use user 'funktionen' attribute to set read/write status for stammdaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1003
diff
changeset
|
24 select: this.buttonToggle, |
77e22ad5cc84
Use user 'funktionen' attribute to set read/write status for stammdaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1003
diff
changeset
|
25 deselect: this.buttonToggle, |
77e22ad5cc84
Use user 'funktionen' attribute to set read/write status for stammdaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1003
diff
changeset
|
26 itemdblclick: this.edit |
984
b21421ba6917
added buttons for datensatzerzeuger, pobenehmer, added controllers
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
27 }, |
b21421ba6917
added buttons for datensatzerzeuger, pobenehmer, added controllers
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
28 'probenehmergrid button[action=add]': { |
b21421ba6917
added buttons for datensatzerzeuger, pobenehmer, added controllers
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
29 click: this.add |
b21421ba6917
added buttons for datensatzerzeuger, pobenehmer, added controllers
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
30 }, |
b21421ba6917
added buttons for datensatzerzeuger, pobenehmer, added controllers
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
31 'probenehmergrid button[action=delete]': { |
b21421ba6917
added buttons for datensatzerzeuger, pobenehmer, added controllers
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
32 click: this.remove |
b21421ba6917
added buttons for datensatzerzeuger, pobenehmer, added controllers
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
33 } |
b21421ba6917
added buttons for datensatzerzeuger, pobenehmer, added controllers
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
34 }); |
b21421ba6917
added buttons for datensatzerzeuger, pobenehmer, added controllers
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
35 }, |
b21421ba6917
added buttons for datensatzerzeuger, pobenehmer, added controllers
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
36 |
1039
77e22ad5cc84
Use user 'funktionen' attribute to set read/write status for stammdaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1003
diff
changeset
|
37 edit: function() { |
77e22ad5cc84
Use user 'funktionen' attribute to set read/write status for stammdaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1003
diff
changeset
|
38 var grid = Ext.ComponentQuery.query('probenehmergrid')[0]; |
77e22ad5cc84
Use user 'funktionen' attribute to set read/write status for stammdaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1003
diff
changeset
|
39 grid.down('button[action=delete]').disable(); |
77e22ad5cc84
Use user 'funktionen' attribute to set read/write status for stammdaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1003
diff
changeset
|
40 }, |
77e22ad5cc84
Use user 'funktionen' attribute to set read/write status for stammdaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1003
diff
changeset
|
41 |
984
b21421ba6917
added buttons for datensatzerzeuger, pobenehmer, added controllers
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
42 /** |
b21421ba6917
added buttons for datensatzerzeuger, pobenehmer, added controllers
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
43 * This function is called when the grids roweditor saves |
b21421ba6917
added buttons for datensatzerzeuger, pobenehmer, added controllers
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
44 * the record. |
b21421ba6917
added buttons for datensatzerzeuger, pobenehmer, added controllers
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
45 * On success it refreshes the windows which contains the grid |
b21421ba6917
added buttons for datensatzerzeuger, pobenehmer, added controllers
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
46 * On failure it displays a message |
b21421ba6917
added buttons for datensatzerzeuger, pobenehmer, added controllers
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
47 */ |
b21421ba6917
added buttons for datensatzerzeuger, pobenehmer, added controllers
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
48 gridSave: function(editor, context) { |
1003
15d8c64049d1
Datensatzerzeuger now uses the server. Added i18n to confirmation messages
Dustin Demuth <dustin@intevation.de>
parents:
984
diff
changeset
|
49 var i18n = Lada.getApplication().bundle; |
984
b21421ba6917
added buttons for datensatzerzeuger, pobenehmer, added controllers
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
50 context.record.save({ |
b21421ba6917
added buttons for datensatzerzeuger, pobenehmer, added controllers
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
51 success: function(record, response) { |
b21421ba6917
added buttons for datensatzerzeuger, pobenehmer, added controllers
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
52 //Do Nothing |
b21421ba6917
added buttons for datensatzerzeuger, pobenehmer, added controllers
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
53 }, |
b21421ba6917
added buttons for datensatzerzeuger, pobenehmer, added controllers
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
54 failure: function(record, response) { |
b21421ba6917
added buttons for datensatzerzeuger, pobenehmer, added controllers
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
55 var json = response.request.scope.reader.jsonData; |
b21421ba6917
added buttons for datensatzerzeuger, pobenehmer, added controllers
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
56 if (json) { |
b21421ba6917
added buttons for datensatzerzeuger, pobenehmer, added controllers
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
57 if (json.message){ |
1003
15d8c64049d1
Datensatzerzeuger now uses the server. Added i18n to confirmation messages
Dustin Demuth <dustin@intevation.de>
parents:
984
diff
changeset
|
58 Ext.Msg.alert(i18n.getMsg('err.msg.save.title') |
984
b21421ba6917
added buttons for datensatzerzeuger, pobenehmer, added controllers
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
59 +' #'+json.message, |
1003
15d8c64049d1
Datensatzerzeuger now uses the server. Added i18n to confirmation messages
Dustin Demuth <dustin@intevation.de>
parents:
984
diff
changeset
|
60 i18n.getMsg(json.message)); |
984
b21421ba6917
added buttons for datensatzerzeuger, pobenehmer, added controllers
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
61 } else { |
1003
15d8c64049d1
Datensatzerzeuger now uses the server. Added i18n to confirmation messages
Dustin Demuth <dustin@intevation.de>
parents:
984
diff
changeset
|
62 Ext.Msg.alert(i18n.getMsg('err.msg.save.title'), |
15d8c64049d1
Datensatzerzeuger now uses the server. Added i18n to confirmation messages
Dustin Demuth <dustin@intevation.de>
parents:
984
diff
changeset
|
63 i18n.getMsg('err.msg.generic.body')); |
984
b21421ba6917
added buttons for datensatzerzeuger, pobenehmer, added controllers
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
64 } |
b21421ba6917
added buttons for datensatzerzeuger, pobenehmer, added controllers
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
65 } |
b21421ba6917
added buttons for datensatzerzeuger, pobenehmer, added controllers
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
66 } |
b21421ba6917
added buttons for datensatzerzeuger, pobenehmer, added controllers
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
67 }); |
b21421ba6917
added buttons for datensatzerzeuger, pobenehmer, added controllers
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
68 }, |
b21421ba6917
added buttons for datensatzerzeuger, pobenehmer, added controllers
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
69 |
b21421ba6917
added buttons for datensatzerzeuger, pobenehmer, added controllers
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
70 /** |
b21421ba6917
added buttons for datensatzerzeuger, pobenehmer, added controllers
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
71 * When the edit was canceled, |
b21421ba6917
added buttons for datensatzerzeuger, pobenehmer, added controllers
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
72 * the empty row might have been created by the roweditor is removed |
b21421ba6917
added buttons for datensatzerzeuger, pobenehmer, added controllers
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
73 */ |
b21421ba6917
added buttons for datensatzerzeuger, pobenehmer, added controllers
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
74 cancelEdit: function(editor, context) { |
b21421ba6917
added buttons for datensatzerzeuger, pobenehmer, added controllers
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
75 if (!context.record.get('id') || |
b21421ba6917
added buttons for datensatzerzeuger, pobenehmer, added controllers
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
76 context.record.get('id') === '') { |
b21421ba6917
added buttons for datensatzerzeuger, pobenehmer, added controllers
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
77 editor.getCmp().store.remove(context.record); |
1039
77e22ad5cc84
Use user 'funktionen' attribute to set read/write status for stammdaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1003
diff
changeset
|
78 this.buttonToggle(); |
984
b21421ba6917
added buttons for datensatzerzeuger, pobenehmer, added controllers
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
79 } |
1039
77e22ad5cc84
Use user 'funktionen' attribute to set read/write status for stammdaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1003
diff
changeset
|
80 else { |
77e22ad5cc84
Use user 'funktionen' attribute to set read/write status for stammdaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1003
diff
changeset
|
81 this.buttonToggle(context.grid.getSelectionModel(), context.record); |
77e22ad5cc84
Use user 'funktionen' attribute to set read/write status for stammdaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1003
diff
changeset
|
82 } |
984
b21421ba6917
added buttons for datensatzerzeuger, pobenehmer, added controllers
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
83 }, |
b21421ba6917
added buttons for datensatzerzeuger, pobenehmer, added controllers
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
84 |
b21421ba6917
added buttons for datensatzerzeuger, pobenehmer, added controllers
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
85 /** |
b21421ba6917
added buttons for datensatzerzeuger, pobenehmer, added controllers
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
86 * This function adds a new row to add a probenehmer |
b21421ba6917
added buttons for datensatzerzeuger, pobenehmer, added controllers
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
87 */ |
b21421ba6917
added buttons for datensatzerzeuger, pobenehmer, added controllers
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
88 add: function(button) { |
b21421ba6917
added buttons for datensatzerzeuger, pobenehmer, added controllers
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
89 var record = Ext.create('Lada.model.Probenehmer'); |
b21421ba6917
added buttons for datensatzerzeuger, pobenehmer, added controllers
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
90 button.up('probenehmergrid').store.insert(0, record); |
b21421ba6917
added buttons for datensatzerzeuger, pobenehmer, added controllers
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
91 button.up('probenehmergrid').rowEditing.startEdit(0, 1); |
b21421ba6917
added buttons for datensatzerzeuger, pobenehmer, added controllers
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
92 }, |
b21421ba6917
added buttons for datensatzerzeuger, pobenehmer, added controllers
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
93 |
b21421ba6917
added buttons for datensatzerzeuger, pobenehmer, added controllers
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
94 /** |
b21421ba6917
added buttons for datensatzerzeuger, pobenehmer, added controllers
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
95 * A record can be removed from the grid with the remove |
b21421ba6917
added buttons for datensatzerzeuger, pobenehmer, added controllers
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
96 * function. It asks the user for confirmation |
b21421ba6917
added buttons for datensatzerzeuger, pobenehmer, added controllers
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
97 * If the removal was confirmed, it reloads the parent window on success, |
b21421ba6917
added buttons for datensatzerzeuger, pobenehmer, added controllers
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
98 * on failure, an error message is shown. |
b21421ba6917
added buttons for datensatzerzeuger, pobenehmer, added controllers
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
99 */ |
b21421ba6917
added buttons for datensatzerzeuger, pobenehmer, added controllers
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
100 remove: function(button) { |
b21421ba6917
added buttons for datensatzerzeuger, pobenehmer, added controllers
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
101 var grid = button.up('grid'); |
b21421ba6917
added buttons for datensatzerzeuger, pobenehmer, added controllers
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
102 var selection = grid.getView().getSelectionModel().getSelection()[0]; |
1003
15d8c64049d1
Datensatzerzeuger now uses the server. Added i18n to confirmation messages
Dustin Demuth <dustin@intevation.de>
parents:
984
diff
changeset
|
103 var i18n = Lada.getApplication().bundle; |
15d8c64049d1
Datensatzerzeuger now uses the server. Added i18n to confirmation messages
Dustin Demuth <dustin@intevation.de>
parents:
984
diff
changeset
|
104 Ext.MessageBox.confirm(i18n.getMsg('delete'), |
15d8c64049d1
Datensatzerzeuger now uses the server. Added i18n to confirmation messages
Dustin Demuth <dustin@intevation.de>
parents:
984
diff
changeset
|
105 i18n.getMsg('confirmation.question'), |
15d8c64049d1
Datensatzerzeuger now uses the server. Added i18n to confirmation messages
Dustin Demuth <dustin@intevation.de>
parents:
984
diff
changeset
|
106 function(btn) { |
984
b21421ba6917
added buttons for datensatzerzeuger, pobenehmer, added controllers
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
107 if (btn === 'yes') { |
b21421ba6917
added buttons for datensatzerzeuger, pobenehmer, added controllers
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
108 selection.destroy({ |
b21421ba6917
added buttons for datensatzerzeuger, pobenehmer, added controllers
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
109 success: function() { |
b21421ba6917
added buttons for datensatzerzeuger, pobenehmer, added controllers
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
110 //DO NOTHING |
b21421ba6917
added buttons for datensatzerzeuger, pobenehmer, added controllers
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
111 }, |
b21421ba6917
added buttons for datensatzerzeuger, pobenehmer, added controllers
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
112 failure: function(request, response) { |
b21421ba6917
added buttons for datensatzerzeuger, pobenehmer, added controllers
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
113 var json = response.request.scope.reader.jsonData; |
b21421ba6917
added buttons for datensatzerzeuger, pobenehmer, added controllers
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
114 if (json) { |
b21421ba6917
added buttons for datensatzerzeuger, pobenehmer, added controllers
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
115 if (json.message){ |
1003
15d8c64049d1
Datensatzerzeuger now uses the server. Added i18n to confirmation messages
Dustin Demuth <dustin@intevation.de>
parents:
984
diff
changeset
|
116 Ext.Msg.alert(i18n.getMsg('err.msg.delete.title') |
984
b21421ba6917
added buttons for datensatzerzeuger, pobenehmer, added controllers
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
117 +' #'+json.message, |
1003
15d8c64049d1
Datensatzerzeuger now uses the server. Added i18n to confirmation messages
Dustin Demuth <dustin@intevation.de>
parents:
984
diff
changeset
|
118 i18n.getMsg(json.message)); |
984
b21421ba6917
added buttons for datensatzerzeuger, pobenehmer, added controllers
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
119 } else { |
1003
15d8c64049d1
Datensatzerzeuger now uses the server. Added i18n to confirmation messages
Dustin Demuth <dustin@intevation.de>
parents:
984
diff
changeset
|
120 Ext.Msg.alert(i18n.getMsg('err.msg.delete.title'), |
15d8c64049d1
Datensatzerzeuger now uses the server. Added i18n to confirmation messages
Dustin Demuth <dustin@intevation.de>
parents:
984
diff
changeset
|
121 i18n.getMsg('err.msg.generic.body')); |
984
b21421ba6917
added buttons for datensatzerzeuger, pobenehmer, added controllers
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
122 } |
b21421ba6917
added buttons for datensatzerzeuger, pobenehmer, added controllers
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
123 } else { |
1003
15d8c64049d1
Datensatzerzeuger now uses the server. Added i18n to confirmation messages
Dustin Demuth <dustin@intevation.de>
parents:
984
diff
changeset
|
124 Ext.Msg.alert(i18n.getMsg('err.msg.delete.title'), |
15d8c64049d1
Datensatzerzeuger now uses the server. Added i18n to confirmation messages
Dustin Demuth <dustin@intevation.de>
parents:
984
diff
changeset
|
125 i18n.getMsg('err.msg.response.body')); |
984
b21421ba6917
added buttons for datensatzerzeuger, pobenehmer, added controllers
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
126 } |
b21421ba6917
added buttons for datensatzerzeuger, pobenehmer, added controllers
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
127 } |
b21421ba6917
added buttons for datensatzerzeuger, pobenehmer, added controllers
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
128 }); |
b21421ba6917
added buttons for datensatzerzeuger, pobenehmer, added controllers
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
129 } |
b21421ba6917
added buttons for datensatzerzeuger, pobenehmer, added controllers
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
130 }); |
b21421ba6917
added buttons for datensatzerzeuger, pobenehmer, added controllers
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
131 grid.down('button[action=delete]').disable(); |
b21421ba6917
added buttons for datensatzerzeuger, pobenehmer, added controllers
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
132 }, |
b21421ba6917
added buttons for datensatzerzeuger, pobenehmer, added controllers
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
133 |
b21421ba6917
added buttons for datensatzerzeuger, pobenehmer, added controllers
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
134 /** |
b21421ba6917
added buttons for datensatzerzeuger, pobenehmer, added controllers
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
135 * Enables/Disables a set of buttons |
b21421ba6917
added buttons for datensatzerzeuger, pobenehmer, added controllers
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
136 **/ |
1039
77e22ad5cc84
Use user 'funktionen' attribute to set read/write status for stammdaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1003
diff
changeset
|
137 buttonToggle: function(rowModel, record) { |
77e22ad5cc84
Use user 'funktionen' attribute to set read/write status for stammdaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1003
diff
changeset
|
138 if (!Ext.Array.contains(Lada.funktionen, 4)) { |
77e22ad5cc84
Use user 'funktionen' attribute to set read/write status for stammdaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1003
diff
changeset
|
139 return; |
77e22ad5cc84
Use user 'funktionen' attribute to set read/write status for stammdaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1003
diff
changeset
|
140 } |
77e22ad5cc84
Use user 'funktionen' attribute to set read/write status for stammdaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1003
diff
changeset
|
141 var grid = Ext.ComponentQuery.query('probenehmergrid')[0]; |
77e22ad5cc84
Use user 'funktionen' attribute to set read/write status for stammdaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1003
diff
changeset
|
142 if (!record) { |
77e22ad5cc84
Use user 'funktionen' attribute to set read/write status for stammdaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1003
diff
changeset
|
143 grid.down('button[action=delete]').disable(); |
77e22ad5cc84
Use user 'funktionen' attribute to set read/write status for stammdaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1003
diff
changeset
|
144 } |
77e22ad5cc84
Use user 'funktionen' attribute to set read/write status for stammdaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1003
diff
changeset
|
145 if (record.get('readonly') || |
77e22ad5cc84
Use user 'funktionen' attribute to set read/write status for stammdaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1003
diff
changeset
|
146 rowModel.selected.items.length === 0) { |
984
b21421ba6917
added buttons for datensatzerzeuger, pobenehmer, added controllers
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
147 grid.down('button[action=delete]').disable(); |
b21421ba6917
added buttons for datensatzerzeuger, pobenehmer, added controllers
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
148 } |
b21421ba6917
added buttons for datensatzerzeuger, pobenehmer, added controllers
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
149 else { |
1039
77e22ad5cc84
Use user 'funktionen' attribute to set read/write status for stammdaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1003
diff
changeset
|
150 if (grid.getPlugin('rowedit').editing) { |
984
b21421ba6917
added buttons for datensatzerzeuger, pobenehmer, added controllers
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
151 //only enable buttons, when grid is not beeing edited |
1039
77e22ad5cc84
Use user 'funktionen' attribute to set read/write status for stammdaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1003
diff
changeset
|
152 grid.down('button[action=delete]').disable(); |
77e22ad5cc84
Use user 'funktionen' attribute to set read/write status for stammdaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1003
diff
changeset
|
153 } |
77e22ad5cc84
Use user 'funktionen' attribute to set read/write status for stammdaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1003
diff
changeset
|
154 else { |
984
b21421ba6917
added buttons for datensatzerzeuger, pobenehmer, added controllers
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
155 grid.down('button[action=delete]').enable(); |
b21421ba6917
added buttons for datensatzerzeuger, pobenehmer, added controllers
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
156 } |
b21421ba6917
added buttons for datensatzerzeuger, pobenehmer, added controllers
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
157 } |
1039
77e22ad5cc84
Use user 'funktionen' attribute to set read/write status for stammdaten.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1003
diff
changeset
|
158 } |
984
b21421ba6917
added buttons for datensatzerzeuger, pobenehmer, added controllers
Dustin Demuth <dustin@intevation.de>
parents:
diff
changeset
|
159 }); |