[Lada-commits] [PATCH 4 of 4] Open messung create window on button click

Wald Commits scm-commit at wald.intevation.org
Mon Mar 16 12:11:18 CET 2015


# HG changeset patch
# User Raimund Renkert <raimund.renkert at intevation.de>
# Date 1426504294 -3600
# Node ID ee92e352be205dfb6ee464b8349c4004e3f0d9ed
# Parent  c3c8a3be511760cc58de0b758ac8b954b65e8ca8
Open messung create window on button click.

diff -r c3c8a3be5117 -r ee92e352be20 app/controller/form/Messung.js
--- a/app/controller/form/Messung.js	Mon Mar 16 12:10:31 2015 +0100
+++ b/app/controller/form/Messung.js	Mon Mar 16 12:11:34 2015 +0100
@@ -32,9 +32,7 @@
         formPanel.getForm().getRecord().save({
             success: function(record, response) {
                 var json = Ext.decode(response.response.responseText);
-                if (response.action !== 'create' &&
-                    json &&
-                    json.success) {
+                if (json) {
                     button.setDisabled(true);
                     button.up('toolbar').down('button[action=discard]')
                         .setDisabled(true);
diff -r c3c8a3be5117 -r ee92e352be20 app/controller/grid/Messung.js
--- a/app/controller/grid/Messung.js	Mon Mar 16 12:10:31 2015 +0100
+++ b/app/controller/grid/Messung.js	Mon Mar 16 12:11:34 2015 +0100
@@ -38,9 +38,13 @@
         win.initData();
     },
 
-    add: function() {
-        // TODO
-        console.log('add');
+    add: function(button) {
+        var probe = button.up('window').record;
+        var win = Ext.create('Lada.view.window.MessungCreate', {
+            record: probe
+        });
+        win.show();
+        win.initData();
     },
 
     remove: function(button) {
@@ -59,6 +63,7 @@
                         }
                     });
                 }
-        });
+            }
+        );
     }
 });


More information about the Lada-commits mailing list