diff app/controller/Proben.js @ 270:0d6552bb28ea

Add cancel Button to the editproben window and only show save button if the form is actually writeable.
author Torsten Irländer <torsten.irlaender@intevation.de>
date Tue, 06 Aug 2013 14:33:14 +0200
parents d8993f5b96e8
children bd77b6055791
line wrap: on
line diff
--- a/app/controller/Proben.js	Mon Jul 29 15:53:24 2013 +0200
+++ b/app/controller/Proben.js	Tue Aug 06 14:33:14 2013 +0200
@@ -23,6 +23,12 @@
             'probenlist toolbar button[action=add]': {
                 click: this.addProbe
             },
+            'probencreate button[action=save]': {
+                click: this.saveProbe
+            },
+            'probenedit button[action=save]': {
+                click: this.saveProbe
+            },
             'probencreate form': {
                 savesuccess: this.createSuccess,
                 savefailure: this.createFailure
@@ -33,6 +39,11 @@
             }
         });
     },
+    saveProbe: function(button) {
+        console.log('Saving Probe');
+        var form = button.up('window').down('form');
+        form.commit();
+    },
     addProbe: function(button) {
         console.log('Adding new Probe');
         var view = Ext.widget('probencreate');

http://lada.wald.intevation.org