diff app/controller/ProbenPlanungSwitcher.js @ 792:d572ee3271ac

some work on a context-sensitive toolbar
author Dustin Demuth <dustin@intevation.de>
date Wed, 13 May 2015 13:00:13 +0200
parents 639e82e2089e
children bc6bc71efb78
line wrap: on
line diff
--- a/app/controller/ProbenPlanungSwitcher.js	Wed May 13 12:40:27 2015 +0200
+++ b/app/controller/ProbenPlanungSwitcher.js	Wed May 13 13:00:13 2015 +0200
@@ -26,7 +26,7 @@
     init: function() {
         this.control({
             'radiofield[name=ppswitch]': {
-                check: this.switchStores
+                check: this.switchModes
             }
         });
         this.callParent(arguments);
@@ -36,22 +36,28 @@
      * Function is called when the user selects a checkbox.
      * according to the checkboxes inputValue,
      * the function alters the store which was loaded by the
-     * filterpanels combobox
+     * filterpanels combobox,
+     * If enabled the function also disables / enables the UI-Buttons
+     * in the Filterresult grid.
      */
-    switchStores: function(field) {
+    switchModes: function(field) {
+
+        var disableButtons = true;
+
         var cbox = field.up('probenplanungswitcher').up().down('combobox');
         var resultGrid = field.up('panel[name=main]').down('filterresultgrid');
         filters = field.up('panel[name=main]').down('fieldset[name=filtervariables]');
         filters.removeAll();
         filters.hide();
         var sname = 'Lada.store.ProbeQueries';
-        if (field.inputValue === 'MessprogrammeList' && cbox) {
+        if (field.inputValue === 'MessprogrammList' && cbox) {
             sname = 'Lada.store.MessprogrammQueries';
         }
-        else if (field.inputValue === 'ProbenList' && cbox) {
+        else if (field.inputValue === 'ProbeList' && cbox) {
             sname = 'Lada.store.ProbeQueries';
         }
 
+
         var store = Ext.StoreManager.lookup(sname);
         if (!store) {
             store = Ext.create(sname);

http://lada.wald.intevation.org