changeset 1379:e95ac7584c2c

Only displaying own messpunkte in ortszuordnung after creation of new messpunkt
author Maximilian Krambach <mkrambach@intevation.de>
date Tue, 14 Feb 2017 14:30:15 +0100
parents 0b2d6db2be7e
children 6ccaeeeb41ad
files app/controller/form/Ortserstellung.js app/view/panel/Map.js app/view/window/Ortszuordnung.js
diffstat 3 files changed, 9 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- 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);
                 }
--- 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();
--- 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');

http://lada.wald.intevation.org