[Lada-commits] [PATCH 2 of 2] Set lon/lat coordinates when selecting a verwaltungseinheit

Wald Commits scm-commit at wald.intevation.org
Thu Dec 5 17:19:01 CET 2013


# HG changeset patch
# User Raimund Renkert <raimund.renkert at intevation.de>
# Date 1386260325 -3600
# Node ID e228fecd15772f738d2ba61cd40ca3e7d14bb942
# Parent  c22b249265001629c3c4a1b417e62e64a1d1333f
Set lon/lat coordinates when selecting a verwaltungseinheit.

diff -r c22b24926500 -r e228fecd1577 app/view/orte/CreateOrt.js
--- a/app/view/orte/CreateOrt.js	Thu Dec 05 17:17:48 2013 +0100
+++ b/app/view/orte/CreateOrt.js	Thu Dec 05 17:18:45 2013 +0100
@@ -28,7 +28,20 @@
             {
                 xtype: 'verwaltungseinheiten',
                 name: 'ort_gemId',
-                fieldLabel: 'Gemeinde'
+                fieldLabel: 'Gemeinde',
+                listeners: {
+                    'select': {
+                        scope: me,
+                        fn: function(field, newValue, oldValue) {
+                            var lon = field.up('window').down(
+                                'numberfield[name=ort_longitude]');
+                            var lat = field.up('window').down(
+                                'numberfield[name=ort_latitude]');
+                            lon.setValue(newValue[0].data.longitude);
+                            lat.setValue(newValue[0].data.latitude);
+                        }
+                    }
+                }
             },
             {
                 xtype: 'numberfield',


More information about the Lada-commits mailing list