changeset 1290:d17501b967f2

combobox ortszuordnungstyp
author Maximilian Krambach <mkrambach@intevation.de>
date Wed, 01 Feb 2017 15:31:41 +0100
parents bfdc00c24baf
children e9f812528324
files app/view/form/Ortszuordnung.js app/view/widget/base/ComboBox.js
diffstat 2 files changed, 21 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/app/view/form/Ortszuordnung.js	Wed Feb 01 14:52:51 2017 +0100
+++ b/app/view/form/Ortszuordnung.js	Wed Feb 01 15:31:41 2017 +0100
@@ -97,17 +97,28 @@
                             name: 'ortszusatztext',
                             fieldLabel: i18n.getMsg('ortszuordnung.form.field.ortszusatztext')
                         }, {
-                            xtype: 'textfield',
+                            xtype: 'cbox',
                             labelWidth: 125,
                             maxLength: 1,
                             allowBlank: false,
-                            regex: /[UEZA]{1}/,
-                            activeError: 'U, E, Z oder A eingeben',
+                            editable: true,
                             name: this.typName,
+                            disableKeyFilter: true,
                             fieldLabel: i18n.getMsg('ortszuordnung.form.field.ortszuordnungtyp'),
-                            listeners: {
-                                change: me.changed
-                            }
+                            store: Ext.create('Ext.data.Store', {
+                                fields: ['value', 'label'],
+                                //TODO: Meaning of the letters should be added
+                                data : [
+                                    {'value':'U', 'label':'U'},
+                                    {'value':'E', 'label':'E'},
+                                    {'value':'Z', 'label':'Z'},
+                                    {'value':'A', 'label':'A'}
+                                ]
+                            }),
+                            displayField: 'label',
+                            valueField: 'value',
+                            emptyText: 'Bitte geben Sie einen Ortszuordnungstyp ein',
+                            queryMode: 'local'
                         }, {
                             // this field is hidden because the user doesn't
                             // need to know the internal ortID
--- a/app/view/widget/base/ComboBox.js	Wed Feb 01 14:52:51 2017 +0100
+++ b/app/view/widget/base/ComboBox.js	Wed Feb 01 15:31:41 2017 +0100
@@ -52,7 +52,10 @@
             msgTarget: 'none',
             value: this.value,
             tpl: this.tpl,
-            displayTpl: this.displayTpl
+            displayTpl: this.displayTpl,
+            // disable filtering of entries if disableKeyFilter is true
+            disableKeyFilter: this.disableKeyFilter || false,
+            triggerAction: this.disableKeyFilter? 'all' : 'query'
         }, {
             xtype: 'image',
             name: 'warnImg',

http://lada.wald.intevation.org