diff app/view/grid/Orte.js @ 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
parents 6075731bc4f1
children 35bbbfbe130c
line wrap: on
line diff
--- 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