changeset 794:bc6bc71efb78

Preselect Proben in PPS, Preselect the first entry in the Filter Combobox
author Dustin Demuth <dustin@intevation.de>
date Mon, 18 May 2015 16:17:14 +0200
parents d4eb8fb99b5e
children 255568e97c96
files app/controller/Filter.js app/controller/ProbenPlanungSwitcher.js app/view/FilterPanel.js app/view/ProbenPlanungSwitcher.js
diffstat 4 files changed, 22 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- 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.
--- 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();
--- 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,
--- 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);

http://lada.wald.intevation.org