[Lada-commits] [PATCH] Preselect Proben in PPS, Preselect the first entry in the Filter Combobox

Wald Commits scm-commit at wald.intevation.org
Mon May 18 16:17:38 CEST 2015


# HG changeset patch
# User Dustin Demuth <dustin at intevation.de>
# Date 1431958634 -7200
# Node ID bc6bc71efb7846f31176b2cae56545346c1f30e4
# Parent  d4eb8fb99b5e8ea8cb740e7616cc3dafc42cb8c8
Preselect Proben in PPS, Preselect the first entry in the Filter Combobox

diff -r d4eb8fb99b5e -r bc6bc71efb78 app/controller/Filter.js
--- a/app/controller/Filter.js	Wed May 13 16:01:24 2015 +0200
+++ b/app/controller/Filter.js	Mon May 18 16:17:14 2015 +0200
@@ -33,8 +33,8 @@
             // CSS like selector to select element in the viewport. See
             // ComponentQuery documentation for more details.
             'combobox[name=filter]': {
-                // Map Doubleclick on rows of the probenlist.
-                select: this.selectSql
+                // Map Select event
+                select: this.selectSql,
             },
             'button[action=search]': {
                 // Map click event on Button.
diff -r d4eb8fb99b5e -r bc6bc71efb78 app/controller/ProbenPlanungSwitcher.js
--- a/app/controller/ProbenPlanungSwitcher.js	Wed May 13 16:01:24 2015 +0200
+++ b/app/controller/ProbenPlanungSwitcher.js	Mon May 18 16:17:14 2015 +0200
@@ -60,7 +60,14 @@
 
         var store = Ext.StoreManager.lookup(sname);
         if (!store) {
-            store = Ext.create(sname);
+            store = Ext.create(sname, {
+                //Select first Item on Load
+                listeners: {
+                    load: function(s){
+                        cbox.select(s.getAt(0).get('id'));
+                    }
+                }
+            });
         }
         if (store) {
             store.load();
diff -r d4eb8fb99b5e -r bc6bc71efb78 app/view/FilterPanel.js
--- a/app/view/FilterPanel.js	Wed May 13 16:01:24 2015 +0200
+++ b/app/view/FilterPanel.js	Mon May 18 16:17:14 2015 +0200
@@ -26,11 +26,20 @@
         this.items = [{
             xtype: 'combobox',
             name: 'filter',
+            id: 'filter-combobox',
             editable: false,
-            store: Ext.create('Lada.store.ProbeQueries'),
+            store: Ext.create('Lada.store.ProbeQueries',{
+                listeners: {
+                    load: function(s){
+                        Ext.getCmp('filter-combobox')
+                            .select(s.getAt(0).get('id'));
+                    }
+                }
+            }),
             displayField: 'name',
             valueField: 'id',
-            emptyText: 'Wählen Sie eine Abfrage'
+            emptyText: 'Wählen Sie eine Abfrage',
+            queryMode: 'local'
         }, {
             xtype: 'panel',
             border: false,
diff -r d4eb8fb99b5e -r bc6bc71efb78 app/view/ProbenPlanungSwitcher.js
--- a/app/view/ProbenPlanungSwitcher.js	Wed May 13 16:01:24 2015 +0200
+++ b/app/view/ProbenPlanungSwitcher.js	Mon May 18 16:17:14 2015 +0200
@@ -33,7 +33,7 @@
                 boxLabel: i18n.getMsg('probelist'),
                 inputValue: 'ProbeList', //this determines the store
                     // which will be loaded,
-                //checked: true,
+                checked: true,
                 handler: function(field, state){
                     if (state === true) {
                         this.fireEvent('check', field);


More information about the Lada-commits mailing list