changeset 622:ee92e352be20

Open messung create window on button click.
author Raimund Renkert <raimund.renkert@intevation.de>
date Mon, 16 Mar 2015 12:11:34 +0100 (2015-03-16)
parents c3c8a3be5117
children e3cdc36cbcae fead63bb5fb4
files app/controller/form/Messung.js app/controller/grid/Messung.js
diffstat 2 files changed, 10 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- 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);
--- 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 @@
                         }
                     });
                 }
-        });
+            }
+        );
     }
 });

http://lada.wald.intevation.org