changeset 271:11f8a2c1b610

Added Cancel Button to all Windows. Changed order howthe form is initialized. Now the form could hide the buttuns in the parent window depending on the readonly flag.
author Torsten Irländer <torsten.irlaender@intevation.de>
date Tue, 06 Aug 2013 16:03:38 +0200
parents 0d6552bb28ea
children 852dc338894e
files app/view/kommentare/Create.js app/view/messungen/Create.js app/view/messungen/Edit.js app/view/messwerte/Create.js app/view/mkommentare/Create.js app/view/orte/Create.js app/view/proben/Create.js app/view/status/Create.js app/view/zusatzwerte/Create.js
diffstat 9 files changed, 56 insertions(+), 16 deletions(-) [+]
line wrap: on
line diff
--- a/app/view/kommentare/Create.js	Tue Aug 06 14:33:14 2013 +0200
+++ b/app/view/kommentare/Create.js	Tue Aug 06 16:03:38 2013 +0200
@@ -13,15 +13,20 @@
         'Lada.view.kommentare.CreateForm'
     ],
     initComponent: function() {
-        var form = Ext.create('Lada.view.kommentare.CreateForm', this.initialConfig);
-        this.items = [form];
         this.buttons = [
             {
                 text: 'Speichern',
                 scope: form,
                 action: 'save'
+            },
+            {
+                text: 'Abbrechen',
+                scope: this,
+                handler: this.close,
             }
         ];
+        var form = Ext.create('Lada.view.kommentare.CreateForm', this.initialConfig);
+        this.items = [form];
         this.callParent();
     }
 });
--- a/app/view/messungen/Create.js	Tue Aug 06 14:33:14 2013 +0200
+++ b/app/view/messungen/Create.js	Tue Aug 06 16:03:38 2013 +0200
@@ -13,15 +13,20 @@
         'Lada.view.messungen.CreateForm'
     ],
     initComponent: function() {
-        var form = Ext.create('Lada.view.messungen.CreateForm', this.initialConfig);
-        this.items = [form];
         this.buttons = [
             {
                 text: 'Speichern',
                 scope: form,
                 action: 'save'
+            },
+            {
+                text: 'Abbrechen',
+                scope: this,
+                handler: this.close,
             }
         ];
+        var form = Ext.create('Lada.view.messungen.CreateForm', this.initialConfig);
+        this.items = [form];
         this.callParent();
     }
 });
--- a/app/view/messungen/Edit.js	Tue Aug 06 14:33:14 2013 +0200
+++ b/app/view/messungen/Edit.js	Tue Aug 06 16:03:38 2013 +0200
@@ -13,15 +13,20 @@
         'Lada.view.messungen.EditForm'
     ],
     initComponent: function() {
-        var form = Ext.create('Lada.view.messungen.EditForm', this.initialConfig);
-        this.items = [form];
         this.buttons = [
             {
                 text: 'Speichern',
                 scope: form,
                 action: 'save'
+            },
+            {
+                text: 'Abbrechen',
+                scope: this,
+                handler: this.close,
             }
         ];
+        var form = Ext.create('Lada.view.messungen.EditForm', this.initialConfig);
+        this.items = [form];
         this.callParent();
     }
 });
--- a/app/view/messwerte/Create.js	Tue Aug 06 14:33:14 2013 +0200
+++ b/app/view/messwerte/Create.js	Tue Aug 06 16:03:38 2013 +0200
@@ -13,6 +13,11 @@
                 text: 'Speichern',
                 scope: form,
                 action: 'save'
+            },
+            {
+                text: 'Abbrechen',
+                scope: this,
+                handler: this.close,
             }
         ];
         var form = Ext.create('Lada.view.messwerte.CreateForm', this.initialConfig);
--- a/app/view/mkommentare/Create.js	Tue Aug 06 14:33:14 2013 +0200
+++ b/app/view/mkommentare/Create.js	Tue Aug 06 16:03:38 2013 +0200
@@ -13,15 +13,20 @@
         'Lada.view.mkommentare.CreateForm'
     ],
     initComponent: function() {
-        var form = Ext.create('Lada.view.mkommentare.CreateForm', this.initialConfig);
-        this.items = [form];
         this.buttons = [
             {
                 text: 'Speichern',
                 scope: form,
                 action: 'save'
+            },
+            {
+                text: 'Abbrechen',
+                scope: this,
+                handler: this.close,
             }
         ];
+        var form = Ext.create('Lada.view.mkommentare.CreateForm', this.initialConfig);
+        this.items = [form];
         this.callParent();
     }
 });
--- a/app/view/orte/Create.js	Tue Aug 06 14:33:14 2013 +0200
+++ b/app/view/orte/Create.js	Tue Aug 06 16:03:38 2013 +0200
@@ -11,15 +11,20 @@
         'Lada.view.orte.CreateForm'
     ],
     initComponent: function() {
-        var form = Ext.create('Lada.view.orte.CreateForm', this.initialConfig);
-        this.items = [form];
         this.buttons = [
             {
                 text: 'Speichern',
                 scope: form,
                 action: 'save'
+            },
+            {
+                text: 'Abbrechen',
+                scope: this,
+                handler: this.close,
             }
         ];
+        var form = Ext.create('Lada.view.orte.CreateForm', this.initialConfig);
+        this.items = [form];
         this.callParent();
     }
 });
--- a/app/view/proben/Create.js	Tue Aug 06 14:33:14 2013 +0200
+++ b/app/view/proben/Create.js	Tue Aug 06 16:03:38 2013 +0200
@@ -11,8 +11,6 @@
     autoScroll: true,
     modal: true,
     initComponent: function() {
-        var form = Ext.create('Lada.view.proben.CreateForm');
-        this.items = [form];
         this.buttons = [
             {
                 text: 'Speichern',
@@ -24,6 +22,8 @@
                 handler: this.close,
             }
         ];
+        var form = Ext.create('Lada.view.proben.CreateForm');
+        this.items = [form];
         this.callParent();
     }
 });
--- a/app/view/status/Create.js	Tue Aug 06 14:33:14 2013 +0200
+++ b/app/view/status/Create.js	Tue Aug 06 16:03:38 2013 +0200
@@ -8,15 +8,20 @@
     modal: true,
 
     initComponent: function() {
-        var form = Ext.create('Lada.view.status.CreateForm', this.initialConfig);
-        this.items = [form];
         this.buttons = [
             {
                 text: 'Speichern',
                 scope: form,
                 action: 'save'
+            },
+            {
+                text: 'Abbrechen',
+                scope: this,
+                handler: this.close,
             }
         ];
+        var form = Ext.create('Lada.view.status.CreateForm', this.initialConfig);
+        this.items = [form];
         this.callParent();
     }
 });
--- a/app/view/zusatzwerte/Create.js	Tue Aug 06 14:33:14 2013 +0200
+++ b/app/view/zusatzwerte/Create.js	Tue Aug 06 16:03:38 2013 +0200
@@ -8,15 +8,20 @@
     modal: true,
 
     initComponent: function() {
-        var form = Ext.create('Lada.view.zusatzwerte.CreateForm', this.initialConfig);
-        this.items = [form];
         this.buttons = [
             {
                 text: 'Speichern',
                 scope: form,
                 action: 'save'
+            },
+            {
+                text: 'Abbrechen',
+                scope: this,
+                handler: this.close,
             }
         ];
+        var form = Ext.create('Lada.view.zusatzwerte.CreateForm', this.initialConfig);
+        this.items = [form];
         this.callParent();
     }
 });

http://lada.wald.intevation.org