changeset 1317:46093e6f45d2

Use the new stammdaten to display and edit ort attributes.
author Raimund Renkert <raimund.renkert@intevation.de>
date Fri, 03 Feb 2017 13:17:54 +0100 (2017-02-03)
parents f772e70ff723
children cc90b8050887
files app.js app/view/grid/Orte.js
diffstat 2 files changed, 76 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/app.js	Fri Feb 03 13:16:53 2017 +0100
+++ b/app.js	Fri Feb 03 13:17:54 2017 +0100
@@ -63,6 +63,10 @@
         'Lada.store.DatensatzErzeuger',
         'Lada.store.MessprogrammKategorie',
         'Lada.store.MessungQueries',
+        'Lada.store.Ktas',
+        'Lada.store.OrtsZusatz',
+        'Lada.store.OrtTyp',
+        'Lada.store.KoordinatenArt',
         'Lada.model.MessstelleLabor'
     ],
     bundle: {
@@ -252,6 +256,22 @@
             storeId: 'stammdatenqueries',
             autoLoad: 'true'
         });
+        Ext.create('Lada.store.Ktas', {
+            storeId: 'ktas',
+            autoLoad: 'true'
+        });
+        Ext.create('Lada.store.OrtsZusatz', {
+            storeId: 'ortszusatz',
+            autoLoad: 'true'
+        });
+        Ext.create('Lada.store.OrtTyp', {
+            storeId: 'orttyp',
+            autoLoad: 'true'
+        });
+        Ext.create('Lada.store.KoordinatenArt', {
+            storeId: 'koordinatenart',
+            autoLoad: 'true'
+        });
 
         //A Store containing all MST a User is allowed to set.
         Ext.create('Lada.store.Messstellen', {
--- a/app/view/grid/Orte.js	Fri Feb 03 13:16:53 2017 +0100
+++ b/app/view/grid/Orte.js	Fri Feb 03 13:17:54 2017 +0100
@@ -14,7 +14,11 @@
     alias: 'widget.ortstammdatengrid',
 
     requires: [
-        'Ext.ux.grid.FiltersFeature'
+        'Ext.ux.grid.FiltersFeature',
+        'Lada.view.widget.KoordinatenArt',
+        'Lada.view.widget.Kta',
+        'Lada.view.widget.OrtsZusatz',
+        'Lada.view.widget.OrtTyp'
     ],
     // minHeight and deferEmptyText are needed to be able to show the
     // emptyText message.
@@ -119,7 +123,18 @@
         }, {
             header: i18n.getMsg('orte.anlageId'),
             editor: {
-                xtype: 'numberfield'
+                xtype: 'kta'
+            },
+            renderer: function(value) {
+                if (value === undefined ||
+                    value === null ||
+                    value === ''
+                ) {
+                    return '';
+                }
+                var store = Ext.data.StoreManager.get('ktas');
+                var record = store.getById(value);
+                return record.get('code');
             },
             dataIndex: 'anlageId'
         }, {
@@ -169,23 +184,59 @@
         }, {
             header: i18n.getMsg('orte.kdaId'),
             filter: {
-                type: 'numeric'
+                type: 'string'
             },
             editor: {
-                xtype: 'numberfield',
+                xtype: 'koordinatenart',
                 allowBlank: false
             },
+            renderer: function(value) {
+                if (value === undefined || value === '') {
+                    return '';
+                }
+                var kda = Ext.data.StoreManager.get('koordinatenart');
+                var record = kda.getById(value);
+                return record.get('koordinatenart');
+            },
             dataIndex: 'kdaId'
         }, {
             header: i18n.getMsg('orte.ozId'),
             filter: {
                 type: 'string'
             },
+            editor: {
+                xtype: 'ortszusatz',
+            },
+            renderer: function(value) {
+                if (value === undefined ||
+                    value === null ||
+                    value === ''
+                ) {
+                    return '';
+                }
+                var oz = Ext.data.StoreManager.get('ortszusatz');
+                var record = oz.getById(value);
+                return record.get('ozsId');
+            },
             dataIndex: 'ozId'
         }, {
             header: i18n.getMsg('orte.ortTyp'),
             filter: {
-                type: 'numeric'
+                type: 'string'
+            },
+            editor: {
+                xtype: 'orttyp',
+            },
+            renderer: function(value) {
+                if (value === undefined ||
+                    value === null ||
+                    value === ''
+                ) {
+                    return '';
+                }
+                var ot = Ext.data.StoreManager.get('orttyp');
+                var record = ot.getById(value);
+                return record.get('code');
             },
             dataIndex: 'ortTyp'
         }, {

http://lada.wald.intevation.org