changeset 172:cfa0cc437781

Implemented opening a new Messungen form when clicking and the "Add Button" on the Messungen listing.
author Torsten Irländer <torsten.irlaender@intevation.de>
date Wed, 03 Jul 2013 16:34:32 +0200
parents c5422819d7b9
children 1a11ae666f11
files app/controller/Messungen.js app/controller/Zusatzwerte.js app/view/messungen/Create.js app/view/messungen/List.js app/view/proben/EditForm.js
diffstat 5 files changed, 14 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/app/controller/Messungen.js	Wed Jul 03 16:13:36 2013 +0200
+++ b/app/controller/Messungen.js	Wed Jul 03 16:34:32 2013 +0200
@@ -1,5 +1,8 @@
 Ext.define('Lada.controller.Messungen', {
     extend: 'Ext.app.Controller',
+    views: [
+        'messungen.Create'
+    ],
     stores: [
         'Messungen',
         'Messwerte',
@@ -31,8 +34,10 @@
         });
     },
     addZusatzwert: function(button) {
-        console.log('Adding new Zusatzwert');
-        var view = Ext.widget('messungencreate');
+        console.log('Adding new Messung for Probe ' + button.probeId);
+        var messung = Ext.create('Lada.model.Messung');
+        messung.set('probeId', button.probeId);
+        var view = Ext.widget('messungencreate', {model: messung});
     },
     editZusatzwert: function(grid, record) {
         console.log('Editing Zusatzwert');
--- a/app/controller/Zusatzwerte.js	Wed Jul 03 16:13:36 2013 +0200
+++ b/app/controller/Zusatzwerte.js	Wed Jul 03 16:34:32 2013 +0200
@@ -41,7 +41,7 @@
         form.commit();
     },
     addZusatzwert: function(button) {
-        console.log('Adding new Zusatzwert for Probe' + button.probenId);
+        console.log('Adding new Zusatzwert for Probe' + button.probeId);
         var zusatzwert = Ext.create('Lada.model.Zusatzwert');
         zusatzwert.set('probeId', button.probeId);
         var view = Ext.widget('zusatzwertecreate', {model: zusatzwert});
--- a/app/view/messungen/Create.js	Wed Jul 03 16:13:36 2013 +0200
+++ b/app/view/messungen/Create.js	Wed Jul 03 16:34:32 2013 +0200
@@ -15,12 +15,11 @@
         'Lada.view.messungen.CreateForm'
     ],
     initComponent: function() {
-        var form = Ext.create('Lada.view.messungen.CreateForm');
+        var form = Ext.create('Lada.view.messungen.CreateForm', this.initialConfig);
         this.items = [form];
         this.buttons = [
             {
                 text: 'Speichern',
-                handler: form.commit,
                 scope: form
             }
         ];
--- a/app/view/messungen/List.js	Wed Jul 03 16:13:36 2013 +0200
+++ b/app/view/messungen/List.js	Wed Jul 03 16:34:32 2013 +0200
@@ -10,6 +10,7 @@
         minHeight: 35,
         deferEmptyText: false
     },
+    probeId: null,
     initComponent: function() {
         this.dockedItems = [
             {
@@ -19,7 +20,8 @@
                     {
                         text: 'Hinzufügen',
                         icon: 'gfx/plus.gif',
-                        action: 'add'
+                        action: 'add',
+                        probeId: this.probeId
                     },
                     {
                         text: 'Löschen',
--- a/app/view/proben/EditForm.js	Wed Jul 03 16:13:36 2013 +0200
+++ b/app/view/proben/EditForm.js	Wed Jul 03 16:34:32 2013 +0200
@@ -200,7 +200,8 @@
                 padding: '10 10',
                 items: [
                     {
-                        xtype: 'messungenlist'
+                        xtype: 'messungenlist',
+                        probeId: this.modelId
                     }
                 ]
             }

http://lada.wald.intevation.org