changeset 1335:cba4e0b0e336

Fixed ort grid selection.
author Raimund Renkert <raimund.renkert@intevation.de>
date Fri, 03 Feb 2017 17:02:55 +0100
parents 2c5d89886885
children f879c806f880
files app/controller/form/Ortszuordnung.js app/view/form/Ortszuordnung.js app/view/panel/Map.js
diffstat 3 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/app/controller/form/Ortszuordnung.js	Fri Feb 03 16:17:46 2017 +0100
+++ b/app/controller/form/Ortszuordnung.js	Fri Feb 03 17:02:55 2017 +0100
@@ -141,7 +141,7 @@
         var win = button.up('window');
         var gridPanel = win.down('panel[name=ortgrid]');
         var osg = win.down('ortstammdatengrid');
-        var oForm = button.up('form');
+        var oForm = button.up('window').down('ortszuordnungform');
         osg.addListener('select',oForm.setOrt, oForm);
         var map = win.down('map');
         if (pressed) {
--- a/app/view/form/Ortszuordnung.js	Fri Feb 03 16:17:46 2017 +0100
+++ b/app/view/form/Ortszuordnung.js	Fri Feb 03 17:02:55 2017 +0100
@@ -148,6 +148,7 @@
 
     setRecord: function(record) {
         this.getForm().loadRecord(record);
+        this.record = record;
         if (!record.get('readonly')) {
             this.down('[action=setOrt]').enable();
             this.setReadOnly(false);
--- a/app/view/panel/Map.js	Fri Feb 03 16:17:46 2017 +0100
+++ b/app/view/panel/Map.js	Fri Feb 03 17:02:55 2017 +0100
@@ -97,6 +97,9 @@
             return;
         }
         var feature = this.featureLayer.getFeaturesByAttribute('id', record.get('id'))[0];
+        if (!feature) {
+            return;
+        }
         this.map.setCenter(
             new OpenLayers.LonLat(feature.geometry.x, feature.geometry.y));
         this.map.zoomTo(12);

http://lada.wald.intevation.org