comparison app/controller/Proben.js @ 490:446e99cfd425

Updated views and controllers using the new model and stores.
author Raimund Renkert <raimund.renkert@intevation.de>
date Fri, 31 Oct 2014 21:28:31 +0100
parents debfcc7713e3
children 850ccfe5f3c4
comparison
equal deleted inserted replaced
489:6056a7fd9aa2 490:446e99cfd425
86 ], 86 ],
87 stores: [ 87 stores: [
88 'Proben', 88 'Proben',
89 'Zusatzwerte', 89 'Zusatzwerte',
90 'Probenzusatzwerte', 90 'Probenzusatzwerte',
91 'Kommentare', 91 'KommentareP',
92 'Orte', 92 'Orte',
93 'Messungen' 93 'Messungen'
94 ], 94 ],
95 init: function() { 95 init: function() {
96 console.log('Initialising the Proben controller'); 96 console.log('Initialising the Proben controller');
198 }); 198 });
199 hiddenForm.getForm().submit(); 199 hiddenForm.getForm().submit();
200 }, 200 },
201 editItem: function(grid, record) { 201 editItem: function(grid, record) {
202 console.log('Editing Probe'); 202 console.log('Editing Probe');
203 var id = record.get('probeId'); 203 var id = record.get('id');
204 console.log('id is: ' + id);
204 // Load Zusatzwerte 205 // Load Zusatzwerte
205 var pstore = this.getProbenzusatzwerteStore(); 206 var pstore = this.getProbenzusatzwerteStore();
206 pstore.load(); 207 pstore.load();
207 var zstore = this.getZusatzwerteStore(); 208 var zstore = this.getZusatzwerteStore();
208 zstore.load({ 209 zstore.load({
209 params: { 210 params: {
210 probeId: id 211 probeId: id
211 } 212 }
212 }); 213 });
213 // Load Kommentare 214 // Load Kommentare
214 var kstore = this.getKommentareStore(); 215 var kstore = this.getKommentarePStore();
215 kstore.load({ 216 kstore.load({
216 params: { 217 params: {
217 probeId: id 218 probeId: id
218 } 219 }
219 }); 220 });
230 params: { 231 params: {
231 probeId: id 232 probeId: id
232 } 233 }
233 }); 234 });
234 var view = Ext.widget('probenedit', {modelId: id}); 235 var view = Ext.widget('probenedit', {modelId: id});
236 view.show();
235 console.log("Loaded Probe with ID " + record.getId()); //outputs ID 237 console.log("Loaded Probe with ID " + record.getId()); //outputs ID
236 }, 238 },
237 createSuccess: function(form, record, response) { 239 createSuccess: function(form, record, response) {
238 // Close Createdialog 240 // Close Createdialog
239 var win = form.up('window'); 241 var win = form.up('window');

http://lada.wald.intevation.org