annotate app/controller/Messungen.js @ 497:7c0653e8d9f7

Fixed some js related issues (unused vars, arrays, etc.) and code style.
author Raimund Renkert <raimund.renkert@intevation.de>
date Thu, 06 Nov 2014 10:38:17 +0100
parents d07e5086a64b
children 8b4ec61c5752
rev   line source
472
debfcc7713e3 Added license header to each file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 362
diff changeset
1 /* Copyright (C) 2013 by Bundesamt fuer Strahlenschutz
debfcc7713e3 Added license header to each file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 362
diff changeset
2 * Software engineering by Intevation GmbH
debfcc7713e3 Added license header to each file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 362
diff changeset
3 *
debfcc7713e3 Added license header to each file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 362
diff changeset
4 * This file is Free Software under the GNU GPL (v>=3)
debfcc7713e3 Added license header to each file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 362
diff changeset
5 * and comes with ABSOLUTELY NO WARRANTY! Check out
497
7c0653e8d9f7 Fixed some js related issues (unused vars, arrays, etc.) and code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 496
diff changeset
6 * the documentation coming with IMIS-Labordaten-Application for details.
472
debfcc7713e3 Added license header to each file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 362
diff changeset
7 */
debfcc7713e3 Added license header to each file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 362
diff changeset
8
289
1bda6420c87c Inherit from Base controller
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 281
diff changeset
9 /**
1bda6420c87c Inherit from Base controller
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 281
diff changeset
10 * Controller for Messungen
1bda6420c87c Inherit from Base controller
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 281
diff changeset
11 */
108
6c69bbb61c65 Added Forms to add Messungen
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
12 Ext.define('Lada.controller.Messungen', {
289
1bda6420c87c Inherit from Base controller
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 281
diff changeset
13 extend: 'Lada.controller.Base',
491
850ccfe5f3c4 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 490
diff changeset
14
172
cfa0cc437781 Implemented opening a new Messungen form when clicking and the "Add Button" on
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 168
diff changeset
15 views: [
232
6ac95f587e10 Used new Editdialog and set the form readonly if the parent probe is readonly.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 229
diff changeset
16 'messungen.Create',
6ac95f587e10 Used new Editdialog and set the form readonly if the parent probe is readonly.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 229
diff changeset
17 'messungen.Edit'
172
cfa0cc437781 Implemented opening a new Messungen form when clicking and the "Add Button" on
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 168
diff changeset
18 ],
491
850ccfe5f3c4 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 490
diff changeset
19
108
6c69bbb61c65 Added Forms to add Messungen
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
20 stores: [
229
80df1451b4a9 Set messung readonly if parent probe is readonly
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 224
diff changeset
21 'Proben',
163
15318541e568 Added MKommentare store. Some cleanup.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 157
diff changeset
22 'Messungen',
168
79a9c1a83305 Added Messwertestore to stores.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 163
diff changeset
23 'Messwerte',
490
446e99cfd425 Updated views and controllers using the new model and stores.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 472
diff changeset
24 'KommentareM',
496
d07e5086a64b Moved stammdaten stores to app.js and load them via storemanager.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 491
diff changeset
25 'Status'
108
6c69bbb61c65 Added Forms to add Messungen
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
26 ],
491
850ccfe5f3c4 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 490
diff changeset
27
108
6c69bbb61c65 Added Forms to add Messungen
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
28 init: function() {
6c69bbb61c65 Added Forms to add Messungen
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
29 console.log('Initialising the Messungen controller');
312
c5b8c0d8aec3 Fix initialisation of Messungen controller
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 289
diff changeset
30 this.callParent();
289
1bda6420c87c Inherit from Base controller
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 281
diff changeset
31 },
491
850ccfe5f3c4 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 490
diff changeset
32
289
1bda6420c87c Inherit from Base controller
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 281
diff changeset
33 addListeners: function() {
108
6c69bbb61c65 Added Forms to add Messungen
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
34 this.control({
6c69bbb61c65 Added Forms to add Messungen
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
35 'messungenlist': {
289
1bda6420c87c Inherit from Base controller
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 281
diff changeset
36 itemdblclick: this.editItem
108
6c69bbb61c65 Added Forms to add Messungen
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
37 },
6c69bbb61c65 Added Forms to add Messungen
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
38 'messungenlist toolbar button[action=add]': {
289
1bda6420c87c Inherit from Base controller
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 281
diff changeset
39 click: this.addItem
108
6c69bbb61c65 Added Forms to add Messungen
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
40 },
6c69bbb61c65 Added Forms to add Messungen
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
41 'messungenlist toolbar button[action=delete]': {
289
1bda6420c87c Inherit from Base controller
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 281
diff changeset
42 click: this.deleteItem
193
93de61af9b9e Renamed function names to Messungen
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 181
diff changeset
43 },
93de61af9b9e Renamed function names to Messungen
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 181
diff changeset
44 'messungencreate button[action=save]': {
289
1bda6420c87c Inherit from Base controller
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 281
diff changeset
45 click: this.saveItem
108
6c69bbb61c65 Added Forms to add Messungen
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
46 },
233
f60472df54e3 Added Listener for save event in edit dialog.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 232
diff changeset
47 'messungenedit button[action=save]': {
289
1bda6420c87c Inherit from Base controller
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 281
diff changeset
48 click: this.saveItem
233
f60472df54e3 Added Listener for save event in edit dialog.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 232
diff changeset
49 },
108
6c69bbb61c65 Added Forms to add Messungen
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
50 'messungencreate form': {
6c69bbb61c65 Added Forms to add Messungen
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
51 savesuccess: this.createSuccess,
6c69bbb61c65 Added Forms to add Messungen
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
52 savefailure: this.createFailure
6c69bbb61c65 Added Forms to add Messungen
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
53 },
6c69bbb61c65 Added Forms to add Messungen
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
54 'messungenedit form': {
6c69bbb61c65 Added Forms to add Messungen
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
55 savesuccess: this.editSuccess,
6c69bbb61c65 Added Forms to add Messungen
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
56 savefailure: this.editFailure
6c69bbb61c65 Added Forms to add Messungen
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
57 }
6c69bbb61c65 Added Forms to add Messungen
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
58 });
6c69bbb61c65 Added Forms to add Messungen
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
59 },
491
850ccfe5f3c4 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 490
diff changeset
60
289
1bda6420c87c Inherit from Base controller
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 281
diff changeset
61 saveItem: function(button) {
194
5d72d74a2daf Added function to save a Messung.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 193
diff changeset
62 console.log('Saving new Messung for Probe ' + button.probeId);
5d72d74a2daf Added function to save a Messung.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 193
diff changeset
63 var form = button.up('window').down('form');
5d72d74a2daf Added function to save a Messung.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 193
diff changeset
64 form.commit();
5d72d74a2daf Added function to save a Messung.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 193
diff changeset
65 },
491
850ccfe5f3c4 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 490
diff changeset
66
289
1bda6420c87c Inherit from Base controller
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 281
diff changeset
67 addItem: function(button) {
172
cfa0cc437781 Implemented opening a new Messungen form when clicking and the "Add Button" on
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 168
diff changeset
68 console.log('Adding new Messung for Probe ' + button.probeId);
cfa0cc437781 Implemented opening a new Messungen form when clicking and the "Add Button" on
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 168
diff changeset
69 var messung = Ext.create('Lada.model.Messung');
cfa0cc437781 Implemented opening a new Messungen form when clicking and the "Add Button" on
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 168
diff changeset
70 messung.set('probeId', button.probeId);
497
7c0653e8d9f7 Fixed some js related issues (unused vars, arrays, etc.) and code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 496
diff changeset
71 Ext.widget('messungencreate', {
7c0653e8d9f7 Fixed some js related issues (unused vars, arrays, etc.) and code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 496
diff changeset
72 model: messung
7c0653e8d9f7 Fixed some js related issues (unused vars, arrays, etc.) and code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 496
diff changeset
73 });
108
6c69bbb61c65 Added Forms to add Messungen
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
74 },
491
850ccfe5f3c4 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 490
diff changeset
75
289
1bda6420c87c Inherit from Base controller
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 281
diff changeset
76 editItem: function(grid, record) {
194
5d72d74a2daf Added function to save a Messung.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 193
diff changeset
77 console.log('Editing Messung');
490
446e99cfd425 Updated views and controllers using the new model and stores.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 472
diff changeset
78 var kstore = this.getKommentareMStore();
195
01021f00ce6a Load kommentare, status and messwerte when editing probe.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 194
diff changeset
79 kstore.load({
01021f00ce6a Load kommentare, status and messwerte when editing probe.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 194
diff changeset
80 params: {
224
5e056c5edf9a Fixed loading stores when editing Messung.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 218
diff changeset
81 probeId: record.get('probeId'),
490
446e99cfd425 Updated views and controllers using the new model and stores.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 472
diff changeset
82 messungsId: record.get('id')
195
01021f00ce6a Load kommentare, status and messwerte when editing probe.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 194
diff changeset
83 }
01021f00ce6a Load kommentare, status and messwerte when editing probe.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 194
diff changeset
84 });
01021f00ce6a Load kommentare, status and messwerte when editing probe.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 194
diff changeset
85 var sstore = this.getStatusStore();
01021f00ce6a Load kommentare, status and messwerte when editing probe.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 194
diff changeset
86 sstore.load({
01021f00ce6a Load kommentare, status and messwerte when editing probe.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 194
diff changeset
87 params: {
224
5e056c5edf9a Fixed loading stores when editing Messung.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 218
diff changeset
88 probeId: record.get('probeId'),
490
446e99cfd425 Updated views and controllers using the new model and stores.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 472
diff changeset
89 messungsId: record.get('id')
195
01021f00ce6a Load kommentare, status and messwerte when editing probe.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 194
diff changeset
90 }
01021f00ce6a Load kommentare, status and messwerte when editing probe.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 194
diff changeset
91 });
224
5e056c5edf9a Fixed loading stores when editing Messung.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 218
diff changeset
92 var mstore = this.getMesswerteStore();
195
01021f00ce6a Load kommentare, status and messwerte when editing probe.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 194
diff changeset
93 mstore.load({
01021f00ce6a Load kommentare, status and messwerte when editing probe.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 194
diff changeset
94 params: {
224
5e056c5edf9a Fixed loading stores when editing Messung.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 218
diff changeset
95 probeId: record.get('probeId'),
490
446e99cfd425 Updated views and controllers using the new model and stores.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 472
diff changeset
96 messungsId: record.get('id')
195
01021f00ce6a Load kommentare, status and messwerte when editing probe.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 194
diff changeset
97 }
01021f00ce6a Load kommentare, status and messwerte when editing probe.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 194
diff changeset
98 });
362
6a7a9267e00f Issue56: Changed way how to set the form and window to readonly. Now all dialogs should
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 312
diff changeset
99 record.getAuthInfo(this.initEditWindow);
497
7c0653e8d9f7 Fixed some js related issues (unused vars, arrays, etc.) and code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 496
diff changeset
100 console.log('Loaded Messung with ID ' + record.getId());
362
6a7a9267e00f Issue56: Changed way how to set the form and window to readonly. Now all dialogs should
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 312
diff changeset
101 },
491
850ccfe5f3c4 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 490
diff changeset
102
362
6a7a9267e00f Issue56: Changed way how to set the form and window to readonly. Now all dialogs should
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 312
diff changeset
103 initEditWindow: function(record, readonly, owner) {
491
850ccfe5f3c4 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 490
diff changeset
104 var view = Ext.widget('messungenedit', {
850ccfe5f3c4 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 490
diff changeset
105 model: record
850ccfe5f3c4 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 490
diff changeset
106 });
497
7c0653e8d9f7 Fixed some js related issues (unused vars, arrays, etc.) and code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 496
diff changeset
107 var ignore = [];
362
6a7a9267e00f Issue56: Changed way how to set the form and window to readonly. Now all dialogs should
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 312
diff changeset
108 if (owner) {
497
7c0653e8d9f7 Fixed some js related issues (unused vars, arrays, etc.) and code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 496
diff changeset
109 ignore.push('fertig');
362
6a7a9267e00f Issue56: Changed way how to set the form and window to readonly. Now all dialogs should
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 312
diff changeset
110 }
6a7a9267e00f Issue56: Changed way how to set the form and window to readonly. Now all dialogs should
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 312
diff changeset
111 if (readonly) {
232
6ac95f587e10 Used new Editdialog and set the form readonly if the parent probe is readonly.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 229
diff changeset
112 var form = view.down('form');
281
12ef979e73ce Partially fixed issue55: Ignore the "fertig" field form when setting the form
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 233
diff changeset
113 form.setReadOnly(true, ignore);
232
6ac95f587e10 Used new Editdialog and set the form readonly if the parent probe is readonly.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 229
diff changeset
114 }
108
6c69bbb61c65 Added Forms to add Messungen
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
115 },
491
850ccfe5f3c4 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 490
diff changeset
116
289
1bda6420c87c Inherit from Base controller
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 281
diff changeset
117 deleteItem: function(button) {
108
6c69bbb61c65 Added Forms to add Messungen
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
118 // Get selected item in grid
6c69bbb61c65 Added Forms to add Messungen
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
119 var grid = button.up('grid');
6c69bbb61c65 Added Forms to add Messungen
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
120 var selection = grid.getView().getSelectionModel().getSelection()[0];
491
850ccfe5f3c4 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 490
diff changeset
121 Ext.MessageBox.confirm('Löschen', 'Sind Sie sicher?', function(btn) {
850ccfe5f3c4 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 490
diff changeset
122 if (btn === 'yes') {
108
6c69bbb61c65 Added Forms to add Messungen
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
123 var store = grid.getStore();
490
446e99cfd425 Updated views and controllers using the new model and stores.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 472
diff changeset
124 var deleteUrl = selection.getProxy().url + selection.getId();
218
1b5a0cb4fa6c Fixed delete call
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 195
diff changeset
125 Ext.Ajax.request({
1b5a0cb4fa6c Fixed delete call
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 195
diff changeset
126 url: deleteUrl,
1b5a0cb4fa6c Fixed delete call
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 195
diff changeset
127 method: 'DELETE',
497
7c0653e8d9f7 Fixed some js related issues (unused vars, arrays, etc.) and code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 496
diff changeset
128 success: function() {
218
1b5a0cb4fa6c Fixed delete call
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 195
diff changeset
129 store.reload();
1b5a0cb4fa6c Fixed delete call
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 195
diff changeset
130 }
1b5a0cb4fa6c Fixed delete call
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 195
diff changeset
131 });
1b5a0cb4fa6c Fixed delete call
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 195
diff changeset
132 console.log('Deleting Messung');
497
7c0653e8d9f7 Fixed some js related issues (unused vars, arrays, etc.) and code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 496
diff changeset
133 }
7c0653e8d9f7 Fixed some js related issues (unused vars, arrays, etc.) and code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 496
diff changeset
134 else {
218
1b5a0cb4fa6c Fixed delete call
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 195
diff changeset
135 console.log('Cancel Deleting Messung');
108
6c69bbb61c65 Added Forms to add Messungen
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
136 }
6c69bbb61c65 Added Forms to add Messungen
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
137 });
6c69bbb61c65 Added Forms to add Messungen
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
138 },
491
850ccfe5f3c4 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 490
diff changeset
139
497
7c0653e8d9f7 Fixed some js related issues (unused vars, arrays, etc.) and code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 496
diff changeset
140 createSuccess: function(form) {
108
6c69bbb61c65 Added Forms to add Messungen
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
141 var store = this.getMessungenStore();
6c69bbb61c65 Added Forms to add Messungen
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
142 store.reload();
6c69bbb61c65 Added Forms to add Messungen
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
143 var win = form.up('window');
6c69bbb61c65 Added Forms to add Messungen
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
144 win.close();
6c69bbb61c65 Added Forms to add Messungen
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
145 },
491
850ccfe5f3c4 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 490
diff changeset
146
497
7c0653e8d9f7 Fixed some js related issues (unused vars, arrays, etc.) and code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 496
diff changeset
147 createFailure: function(form) {
108
6c69bbb61c65 Added Forms to add Messungen
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
148 Ext.MessageBox.show({
6c69bbb61c65 Added Forms to add Messungen
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
149 title: 'Fehler beim Speichern',
6c69bbb61c65 Added Forms to add Messungen
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
150 msg: form.message,
6c69bbb61c65 Added Forms to add Messungen
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
151 icon: Ext.MessageBox.ERROR,
6c69bbb61c65 Added Forms to add Messungen
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
152 buttons: Ext.Msg.OK
6c69bbb61c65 Added Forms to add Messungen
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
153 });
6c69bbb61c65 Added Forms to add Messungen
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
154 },
491
850ccfe5f3c4 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 490
diff changeset
155
497
7c0653e8d9f7 Fixed some js related issues (unused vars, arrays, etc.) and code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 496
diff changeset
156 editSuccess: function(form) {
108
6c69bbb61c65 Added Forms to add Messungen
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
157 var store = this.getMessungenStore();
6c69bbb61c65 Added Forms to add Messungen
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
158 store.reload();
6c69bbb61c65 Added Forms to add Messungen
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
159 var win = form.up('window');
6c69bbb61c65 Added Forms to add Messungen
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
160 win.close();
6c69bbb61c65 Added Forms to add Messungen
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
161 },
491
850ccfe5f3c4 Code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 490
diff changeset
162
497
7c0653e8d9f7 Fixed some js related issues (unused vars, arrays, etc.) and code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 496
diff changeset
163 editFailure: function(form) {
108
6c69bbb61c65 Added Forms to add Messungen
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
164 Ext.MessageBox.show({
6c69bbb61c65 Added Forms to add Messungen
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
165 title: 'Fehler beim Speichern',
6c69bbb61c65 Added Forms to add Messungen
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
166 msg: form.message,
6c69bbb61c65 Added Forms to add Messungen
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
167 icon: Ext.MessageBox.ERROR,
6c69bbb61c65 Added Forms to add Messungen
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
168 buttons: Ext.Msg.OK
6c69bbb61c65 Added Forms to add Messungen
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
169 });
6c69bbb61c65 Added Forms to add Messungen
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
170 }
6c69bbb61c65 Added Forms to add Messungen
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
171 });

http://lada.wald.intevation.org