[Lada-commits] [PATCH] Use the new stammdaten to display and edit ort attributes

Wald Commits scm-commit at wald.intevation.org
Fri Feb 3 13:17:59 CET 2017


# HG changeset patch
# User Raimund Renkert <raimund.renkert at intevation.de>
# Date 1486124274 -3600
# Node ID 46093e6f45d25377ccf43ef5b2d20266a96ba9a6
# Parent  f772e70ff723b7f8e62e697a0b8d6c3e25f5af46
Use the new stammdaten to display and edit ort attributes.

diff -r f772e70ff723 -r 46093e6f45d2 app.js
--- 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', {
diff -r f772e70ff723 -r 46093e6f45d2 app/view/grid/Orte.js
--- 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'
         }, {


More information about the Lada-commits mailing list