changeset 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 4a79323336c6
children 32e1356cf391
files app/controller/MKommentare.js
diffstat 1 files changed, 30 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/app/controller/MKommentare.js	Mon Jul 08 16:47:18 2013 +0200
@@ -0,0 +1,30 @@
+Ext.define('Lada.controller.MKommentare', {
+    extend: 'Lada.controller.Kommentare',
+    stores: [
+        'MKommentare'
+    ],
+    models: [
+        'MKommentar'
+    ],
+    addKommentar: function(button) {
+        console.log('Adding new Kommentar for Messung ' + button.parentId + ' Probe ' + button.probeId);
+        var kommentar = Ext.create('Lada.model.MKommentar');
+        kommentar.set('probeId', button.probeId);
+        kommentar.set('messungsId', button.parentId);
+        var view = Ext.widget('kommentarecreate', {model: kommentar});
+    },
+    createSuccess: function(form, record, operation) {
+        // Reload store
+        var store = this.getMKommentareStore();
+        store.reload();
+        var win = form.up('window');
+        win.close();
+    },
+    editSuccess: function(form, record, operation) {
+        // Reload store
+        var store = this.getMKommentareStore();
+        store.reload();
+        var win = form.up('window');
+        win.close();
+    }
+});

http://lada.wald.intevation.org