annotate app/controller/MKommentare.js @ 205:cd8cd3ac0231

Added new Controller for MKommentare.
author Torsten Irländer <torsten.irlaender@intevation.de>
date Mon, 08 Jul 2013 16:47:18 +0200
parents
children 62e116cd3e3b
rev   line source
205
cd8cd3ac0231 Added new Controller for MKommentare.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
1 Ext.define('Lada.controller.MKommentare', {
cd8cd3ac0231 Added new Controller for MKommentare.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
2 extend: 'Lada.controller.Kommentare',
cd8cd3ac0231 Added new Controller for MKommentare.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
3 stores: [
cd8cd3ac0231 Added new Controller for MKommentare.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
4 'MKommentare'
cd8cd3ac0231 Added new Controller for MKommentare.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
5 ],
cd8cd3ac0231 Added new Controller for MKommentare.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
6 models: [
cd8cd3ac0231 Added new Controller for MKommentare.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
7 'MKommentar'
cd8cd3ac0231 Added new Controller for MKommentare.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
8 ],
cd8cd3ac0231 Added new Controller for MKommentare.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
9 addKommentar: function(button) {
cd8cd3ac0231 Added new Controller for MKommentare.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
10 console.log('Adding new Kommentar for Messung ' + button.parentId + ' Probe ' + button.probeId);
cd8cd3ac0231 Added new Controller for MKommentare.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
11 var kommentar = Ext.create('Lada.model.MKommentar');
cd8cd3ac0231 Added new Controller for MKommentare.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
12 kommentar.set('probeId', button.probeId);
cd8cd3ac0231 Added new Controller for MKommentare.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
13 kommentar.set('messungsId', button.parentId);
cd8cd3ac0231 Added new Controller for MKommentare.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
14 var view = Ext.widget('kommentarecreate', {model: kommentar});
cd8cd3ac0231 Added new Controller for MKommentare.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
15 },
cd8cd3ac0231 Added new Controller for MKommentare.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
16 createSuccess: function(form, record, operation) {
cd8cd3ac0231 Added new Controller for MKommentare.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
17 // Reload store
cd8cd3ac0231 Added new Controller for MKommentare.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
18 var store = this.getMKommentareStore();
cd8cd3ac0231 Added new Controller for MKommentare.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
19 store.reload();
cd8cd3ac0231 Added new Controller for MKommentare.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
20 var win = form.up('window');
cd8cd3ac0231 Added new Controller for MKommentare.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
21 win.close();
cd8cd3ac0231 Added new Controller for MKommentare.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
22 },
cd8cd3ac0231 Added new Controller for MKommentare.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
23 editSuccess: function(form, record, operation) {
cd8cd3ac0231 Added new Controller for MKommentare.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
24 // Reload store
cd8cd3ac0231 Added new Controller for MKommentare.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
25 var store = this.getMKommentareStore();
cd8cd3ac0231 Added new Controller for MKommentare.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
26 store.reload();
cd8cd3ac0231 Added new Controller for MKommentare.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
27 var win = form.up('window');
cd8cd3ac0231 Added new Controller for MKommentare.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
28 win.close();
cd8cd3ac0231 Added new Controller for MKommentare.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
29 }
cd8cd3ac0231 Added new Controller for MKommentare.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
30 });

http://lada.wald.intevation.org