changeset 1323:754db8d73691

merged
author Raimund Renkert <raimund.renkert@intevation.de>
date Fri, 03 Feb 2017 14:32:28 +0100
parents 6edab3ee2198 (diff) 518b4c28e71a (current diff)
children 09d121acda6c
files app/view/form/Ortserstellung.js
diffstat 7 files changed, 45 insertions(+), 27 deletions(-) [+]
line wrap: on
line diff
--- a/app/controller/grid/Ortszuordnung.js	Fri Feb 03 14:25:38 2017 +0100
+++ b/app/controller/grid/Ortszuordnung.js	Fri Feb 03 14:32:28 2017 +0100
@@ -208,6 +208,8 @@
         if (evt.getKey() === 27) {
             if (this.resultPanel.isVisible()) {
                 this.resultPanel.close();
+                verwaltungseinheiten.clearFilter(true);
+                staaten.clearFilter(true);
                 return;
             }
             else {
@@ -221,6 +223,8 @@
         }
         if (field.getValue().length === 0) {
             this.resultPanel.hide();
+            verwaltungseinheiten.clearFilter(true);
+            staaten.clearFilter(true);
             return;
         }
         if (field.getValue().length < 3) {
@@ -236,12 +240,19 @@
     execSearch: function(field, filter) {
         // Filter stores
         var messpunkte = Ext.data.StoreManager.get('orte');
+        var cloneRecords = [];
+        messpunkte.each(function(r) {
+            cloneRecords.push(r.copy());
+        });
+        var filterMesspunkte = Ext.create('Lada.store.Orte',{
+            autoLoad: false
+        });
+        filterMesspunkte.add(cloneRecords);
         var verwaltungseinheiten = Ext.data.StoreManager.get('verwaltungseinheiten');
         var staaten = Ext.data.StoreManager.get('staaten');
-        messpunkte.clearFilter(true);
         verwaltungseinheiten.clearFilter(true);
         staaten.clearFilter(true);
-        messpunkte.filter({filterFn: function(item) {
+        filterMesspunkte.filter({filterFn: function(item) {
                 if (item.get('ortId').indexOf(filter) > -1) {
                     return true;
                 }
@@ -272,7 +283,7 @@
             });
         }
         this.resultPanel.show();
-        this.resultPanel.updateGrids(messpunkte, verwaltungseinheiten, staaten);
+        this.resultPanel.updateGrids(filterMesspunkte, verwaltungseinheiten, staaten);
         this.resultPanel.reposition(field.getX() + field.getLabelWidth(), field.getY());
         field.focus();
     },
--- a/app/view/form/Ortserstellung.js	Fri Feb 03 14:25:38 2017 +0100
+++ b/app/view/form/Ortserstellung.js	Fri Feb 03 14:32:28 2017 +0100
@@ -20,6 +20,8 @@
 
     margin: 5,
 
+    border: 0,
+
     record: null,
 
     trackResetOnLoad: true,
@@ -44,6 +46,7 @@
             fieldLabel: i18n.getMsg('orte.ortId')
         }, {
             xtype: 'checkbox',
+            labelWidth: 125,
             name: 'aktiv',
             fieldLabel: 'aktiv:'
         },{
@@ -132,7 +135,7 @@
             fieldLabel: i18n.getMsg('orte.berichtstext'),
             name: 'berichtstext'
         }, {
-            xtype: 'tfield',
+            xtype: 'kta',
             labelWidth: 125,
             maxLength: 100,
             name: 'anlageId',
@@ -150,7 +153,7 @@
             name: 'sektor',
             fieldLabel: i18n.getMsg('orte.sektor')
         },{
-            xtype: 'tfield',
+            xtype: 'orttyp',
             labelWidth: 125,
             maxLength: 100,
             name: 'ortTyp',
@@ -174,7 +177,7 @@
             name: 'nutsCode',
             fieldLabel: i18n.getMsg('orte.nutsCode')
         },{
-            xtype: 'tfield',
+            xtype: 'ortszusatz',
             labelWidth: 125,
             maxLength: 7,
             name: 'ozId',
@@ -184,7 +187,6 @@
         this.dockedItems = [{
             xtype: 'toolbar',
             dock: 'bottom',
-            ui: 'footer',
             border: '0, 1, 1, 1',
             style: {
                 borderBottom: '1px solid #b5b8c8 !important',
@@ -194,14 +196,14 @@
             items: ['->', {
                 text: i18n.getMsg('save'),
                 action: 'save',
-                handler: me.saveOrt,
+                qtip: 'Daten speichern',
+                icon: 'resources/img/dialog-ok-apply.png',
                 disabled: true
             }, {
-                text: i18n.getMsg('close'),
-                action: 'close',
-                handler: function() {
-                    me.close();
-                }
+                text: i18n.getMsg('discard'),
+                qtip: 'Änderungen verwerfen',
+                icon: 'resources/img/dialog-cancel.png',
+                action: 'revert',
             }]
         }];
 
--- a/app/view/form/Ortszuordnung.js	Fri Feb 03 14:25:38 2017 +0100
+++ b/app/view/form/Ortszuordnung.js	Fri Feb 03 14:32:28 2017 +0100
@@ -74,6 +74,11 @@
                         icon: 'resources/img/dialog-ok-apply.png',
                         action: 'save',
                         disabled: true
+                    }, {
+                        text: i18n.getMsg('discard'),
+                        qtip: 'Änderungen verwerfen',
+                        icon: 'resources/img/dialog-cancel.png',
+                        action: 'revert',
                     }]
                 }],
                 items: [{
--- a/app/view/widget/Kta.js	Fri Feb 03 14:25:38 2017 +0100
+++ b/app/view/widget/Kta.js	Fri Feb 03 14:32:28 2017 +0100
@@ -15,10 +15,14 @@
     store: 'Ktas',
     displayField: 'id',
     valueField: 'id',
+    editable: this.editable || false,
+    forceSelection: true,
     // Enable filtering of comboboxes
+    autoSelect: false,
     queryMode: 'local',
     triggerAction: 'all',
     typeAhead: false,
+    minChars: 0,
     tpl: Ext.create("Ext.XTemplate",
         '<tpl for="."><div class="x-combo-list-item  x-boundlist-item" >' +
             '{code} - {bezeichnung}</div></tpl>'),
@@ -33,9 +37,6 @@
         if (!this.store) {
             this.store = Ext.create('Lada.store.Ktas');
         }
-        else {
-            this.store.clearFilter();
-        }
         this.callParent(arguments);
     }
 });
--- a/app/view/widget/OrtTyp.js	Fri Feb 03 14:25:38 2017 +0100
+++ b/app/view/widget/OrtTyp.js	Fri Feb 03 14:32:28 2017 +0100
@@ -15,10 +15,14 @@
     store: 'OrtTyp',
     displayField: 'id',
     valueField: 'id',
+    editable: this.editable || false,
+    forceSelection: true,
     // Enable filtering of comboboxes
+    autoSelect: false,
     queryMode: 'local',
     triggerAction: 'all',
     typeAhead: false,
+    minChars: 0,
     tpl: Ext.create("Ext.XTemplate",
         '<tpl for="."><div class="x-combo-list-item  x-boundlist-item" >' +
             '{code} - {ortTyp}</div></tpl>'),
@@ -33,9 +37,6 @@
         if (!this.store) {
             this.store = Ext.create('Lada.store.OrtTyp');
         }
-        else {
-            this.store.clearFilter();
-        }
         this.callParent(arguments);
     }
 });
--- a/app/view/window/Ortserstellung.js	Fri Feb 03 14:25:38 2017 +0100
+++ b/app/view/window/Ortserstellung.js	Fri Feb 03 14:32:28 2017 +0100
@@ -51,6 +51,11 @@
                 }
             })
         ];
+        this.buttons = [{
+            text: 'Schließen',
+            scope: this,
+            handler: this.close
+        }];
         this.callParent(arguments);
     }
-});
\ No newline at end of file
+});
--- a/app/view/window/Ortszuordnung.js	Fri Feb 03 14:25:38 2017 +0100
+++ b/app/view/window/Ortszuordnung.js	Fri Feb 03 14:32:28 2017 +0100
@@ -137,13 +137,6 @@
                 dockedItems: [{
                     xtype: 'toolbar',
                     dock: 'bottom',
-                    ui: 'footer',
-                    border: '0, 1, 1, 1',
-                    style: {
-                        borderBottom: '1px solid #b5b8c8 !important',
-                        borderLeft: '1px solid #b5b8c8 !important',
-                        borderRight: '1px solid #b5b8c8 !important'
-                    },
                     items: [{
                         xtype: 'textfield',
                         name: 'search',

http://lada.wald.intevation.org