changeset 1134:f1d21e6a7449

Fixed adding new ortszuortnung for probe objects.
author Raimund Renkert <raimund.renkert@intevation.de>
date Wed, 25 May 2016 14:52:41 +0200
parents df6d1a2cdd4a
children 6408811c5c41 a3a715417540
files app/controller/form/Ortszuordnung.js app/view/form/Ortszuordnung.js app/view/window/Ortszuordnung.js
diffstat 3 files changed, 11 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/app/controller/form/Ortszuordnung.js	Wed May 25 14:36:51 2016 +0200
+++ b/app/controller/form/Ortszuordnung.js	Wed May 25 14:52:41 2016 +0200
@@ -66,7 +66,7 @@
                     formPanel.clearMessages();
                     formPanel.setRecord(record);
                     formPanel.setMessages(json.errors, json.warnings);
-                    formPanel.up('window').grid.store.reload();
+                    formPanel.up('window').parentWindow.initData();
                 }
                 //try to refresh the Grid of the Probe
                 try {
--- a/app/view/form/Ortszuordnung.js	Wed May 25 14:36:51 2016 +0200
+++ b/app/view/form/Ortszuordnung.js	Wed May 25 14:52:41 2016 +0200
@@ -146,6 +146,9 @@
     refreshOrt: function(ortId) {
         var orteStore = Ext.StoreManager.get('orte');
         var ort = orteStore.getById(ortId);
+        if (!ort) {
+            return;
+        }
         var verwStore = Ext.StoreManager.get('verwaltungseinheiten');
         var verw = verwStore.getById(ort.get('gemId'));
         var staatStore = Ext.StoreManager.get('staaten');
--- a/app/view/window/Ortszuordnung.js	Wed May 25 14:36:51 2016 +0200
+++ b/app/view/window/Ortszuordnung.js	Wed May 25 14:52:41 2016 +0200
@@ -99,6 +99,13 @@
      * Initialise the Data of this Window
      */
     initData: function() {
+        if (!this.record) {
+            this.record = Ext.create('Lada.model.Ortszuordnung');
+            if (!this.record.get('letzteAenderung')) {
+                this.record.data.letzteAenderung = new Date();
+            }
+            this.record.set('probeId', this.probe.get('id'));
+        }
         this.down('ortszuordnungform').setRecord(this.record);
         this.down('ortpanel').setStore();
     },

http://lada.wald.intevation.org