[Lada-commits] [PATCH 3 of 4] Added new Controller for MKommentare

Wald Commits scm-commit at wald.intevation.org
Mon Jul 8 16:48:49 CEST 2013


# HG changeset patch
# User Torsten Irländer <torsten.irlaender at intevation.de>
# Date 1373294838 -7200
# Node ID cd8cd3ac02310d30ab88af9993cf2e37bb7cda89
# Parent  4a79323336c6d88f7a3f5a98979601fda9740712
Added new Controller for MKommentare.

diff -r 4a79323336c6 -r cd8cd3ac0231 app/controller/MKommentare.js
--- /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();
+    }
+});


More information about the Lada-commits mailing list