diff app/controller/ModeSwitcher.js @ 1015:af9879d72310

Updated UI, added window for filter management and added fieldset for query details.
author Raimund Renkert <raimund.renkert@intevation.de>
date Tue, 02 Feb 2016 15:25:16 +0100
parents 7f5219b8e1bf
children d6e259e76de6
line wrap: on
line diff
--- a/app/controller/ModeSwitcher.js	Thu Jan 21 08:59:13 2016 +0100
+++ b/app/controller/ModeSwitcher.js	Tue Feb 02 15:25:16 2016 +0100
@@ -46,48 +46,8 @@
         filters.removeAll();
         filters.hide();
 
-        //Initialise variables which will define the querystore
-        // and the store which has to be loaded into the grid.
-        var querystorename = '';
-
-        // In dependence of the checkboxes input value,
-        // define the store of the filter.
-        //    app/controller/Filter.js contains similar code.
-        if (field.inputValue === 'messprogramme' && cbox) {
-            querystorename = 'Lada.store.MessprogrammQueries';
-        }
-        else if (field.inputValue === 'proben' && cbox) {
-            querystorename = 'Lada.store.ProbeQueries';
-        }
-        else if (field.inputValue === 'stammdaten' && cbox) {
-            querystorename = 'Lada.store.StammdatenQueries';
-        }
-
-        if (querystorename) {
-            var store = Ext.StoreManager.lookup(querystorename);
-
-            if (!store) {
-                store = Ext.create(querystorename, {
-                    //Select first Item on Load
-                    listeners: {
-                        load: function(store){
-                            var records = new Array();
-                            records.push(store.getAt(0));
-
-                            cbox.select(records[0]);
-                            cbox.fireEvent('select', cbox, records);
-                        }
-                    }
-                });
-            }
-
-            if (store) {
-                if (!store.autoLoad) {
-                    store.load();
-                }
-                //cbox.reset();
-                cbox.bindStore(store);
-            }
-        }
+        var filterController = this.getController('Lada.controller.Filter');
+        filterController.mode = field.inputValue;
+        filterController.updateFilter(cbox);
     }
 });

http://lada.wald.intevation.org