[Lada-commits] [PATCH] Only displaying own messpunkte in ortszuordnung after creation of new messpunkt

Wald Commits scm-commit at wald.intevation.org
Tue Feb 14 14:30:20 CET 2017


# HG changeset patch
# User Maximilian Krambach <mkrambach at intevation.de>
# Date 1487079015 -3600
# Node ID e95ac7584c2c59ce40029834a5feb54880d7f42e
# Parent  0b2d6db2be7e6bdccda36e15faf5893a06eba7b2
Only displaying own messpunkte in ortszuordnung after creation of new messpunkt

diff -r 0b2d6db2be7e -r e95ac7584c2c app/controller/form/Ortserstellung.js
--- a/app/controller/form/Ortserstellung.js	Tue Feb 14 11:06:05 2017 +0100
+++ b/app/controller/form/Ortserstellung.js	Tue Feb 14 14:30:15 2017 +0100
@@ -73,6 +73,7 @@
                 if (ozw.ortstore) {
                     ozw.ortstore.load({
                         callback: function(records, operation, success) {
+                            ozw.ortstore.filter('netzbetreiberId', Lada.netzbetreiber[0]);
                             ozw.down('map').addLocations(ozw.ortstore);
                             var osg = ozw.down('ortstammdatengrid');
                             osg.setStore(ozw.ortstore);
@@ -82,7 +83,11 @@
                     });
                 } else {
                     var osgstore = ozw.down('ortstammdatengrid').getStore();
-                    osgstore.load();
+                    osgstore.load({
+                        callback: function() {
+                            osgstore.filter('netzbetreiberId', Lada.netzbetreiber[0]);
+                        }
+                    });
                     ozw.down('map').addLocations(osgstore);
                     me.afterSave(formpanel, json);
                 }
diff -r 0b2d6db2be7e -r e95ac7584c2c app/view/panel/Map.js
--- a/app/view/panel/Map.js	Tue Feb 14 11:06:05 2017 +0100
+++ b/app/view/panel/Map.js	Tue Feb 14 14:30:15 2017 +0100
@@ -205,7 +205,9 @@
         }
         this.featureLayer.removeAllFeatures();
         this.featureLayer.addFeatures(locationFeatures);
-        if (this.selectedFeatureLayer && this.selectedFeatureLayer.features){
+        if (this.selectedFeatureLayer
+            && this.selectedFeatureLayer.features
+            && this.selectedFeatureLayer.features.length > 0){
             var oldSelection = this.selectedFeatureLayer.features[0].data.id;
             var feature = this.featureLayer.getFeaturesByAttribute('id', oldSelection)[0];
             this.selectControl.unselectAll();
diff -r 0b2d6db2be7e -r e95ac7584c2c app/view/window/Ortszuordnung.js
--- a/app/view/window/Ortszuordnung.js	Tue Feb 14 11:06:05 2017 +0100
+++ b/app/view/window/Ortszuordnung.js	Tue Feb 14 14:30:15 2017 +0100
@@ -185,7 +185,6 @@
         osg.setLoading(true);
         map.setLoading(true);
         this.ortstore = Ext.data.StoreManager.get('orte');
-        this.ortstore.load();
         var ortId;
         if (this.messprogramm) {
             ortId = this.record.get('ort');


More information about the Lada-commits mailing list