diff app/view/proben/Edit.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 7b1140bd8b3d
children 6007d11b81c2
line wrap: on
line diff
--- a/app/view/proben/Edit.js	Mon Jul 29 15:53:24 2013 +0200
+++ b/app/view/proben/Edit.js	Tue Aug 06 14:33:14 2013 +0200
@@ -12,19 +12,23 @@
     modal: true,
 
     initComponent: function() {
+        this.buttons = [
+            {
+                text: 'Speichern',
+                action: 'save',
+            },
+            {
+                text: 'Abbrechen',
+                scope: this,
+                handler: this.close,
+            }
+        ];
         // InitialConfig is the config object passed to the constructor on
         // creation of this window. We need to pass it throuh to the form as
         // we need the "modelId" param to load the correct item.
         var form = Ext.create('Lada.view.proben.EditForm', this.initialConfig);
         this.items = [form];
-        this.buttons = [
-            {
-                text: 'Speichern',
-                handler: form.commit,
-                scope: form
-            }
-        ];
         this.callParent();
-    }
+    },
 });
 

http://lada.wald.intevation.org