diff app/view/ProbenPlanungSwitcher.js @ 751:704bb359c0fe

dynamically exchange the store of the resultfiltergrid
author Dustin Demuth <dustin@intevation.de>
date Tue, 28 Apr 2015 16:03:59 +0200
parents 3ffecbce17d6
children d572ee3271ac
line wrap: on
line diff
--- a/app/view/ProbenPlanungSwitcher.js	Tue Apr 28 11:53:39 2015 +0200
+++ b/app/view/ProbenPlanungSwitcher.js	Tue Apr 28 16:03:59 2015 +0200
@@ -10,7 +10,7 @@
  * This is a Widget for a ProbenPlanungSwitcher
  */
 Ext.define('Lada.view.ProbenPlanungSwitcher', {
-    extend: 'Ext.form.RadioGroup',
+    extend: 'Ext.form.FieldSet',
     alias: 'widget.probenplanungswitcher',
 
     mixins: {
@@ -21,43 +21,36 @@
      * When the Checkbox is checked, it fires a 'check' Event
      */
     initComponent: function() {
-       var i18n = Lada.getApplication().bundle;
-       this.items= [{
-            xtype: 'panel',
-            border: false,
+        var i18n = Lada.getApplication().bundle;
+        this.title = i18n.getMsg('modus');
+        this.items= [{
+            xtype: 'radiogroup',
+            columns: 1,
+            width: '100%',
             items: [{
-                xtype: 'radiogroup',
-                fieldLabel: i18n.getMsg('modus'),
-                //labelWidth: '30 px',
-                columns: 'auto',
-                vertical: false,
-                width: '100%',
-                items: [{
-                    xtype: 'radiofield',
-                    name: 'ppswitch',
-                    boxLabel: i18n.getMsg('probelist'),
-                    boxLabelAlign: 'before',
-                    inputValue: 'probenliste',
-                    checked: true,
-                    handler: function(field, state){
-                        if (state === true) {
-                            this.fireEvent('check', field);
-                        }
+                xtype: 'radiofield',
+                name: 'ppswitch',
+                boxLabel: i18n.getMsg('probelist'),
+                inputValue: 'ProbenList', //this determines the store
+                    // which will be loaded,
+                checked: true,
+                handler: function(field, state){
+                    if (state === true) {
+                        this.fireEvent('check', field);
                     }
-                },{
-                    xtype: 'radiofield',
-                    name: 'ppswitch',
-                    boxLabel: i18n.getMsg('probeplanning'),
-                    boxLabelAlign: 'before',
-                    inputValue: 'probenplanung',
-                    handler: function(field, state){
-                        if (state === true) {
-                            this.fireEvent('check', field);
-                        }
+                }
+            },{
+                xtype: 'radiofield',
+                name: 'ppswitch',
+                boxLabel: i18n.getMsg('probeplanning'),
+                inputValue: 'MessprogrammeList', //name of a store
+                handler: function(field, state){
+                    if (state === true) {
+                        this.fireEvent('check', field);
                     }
-                 }]
+                }
             }]
-       }];
-       this.callParent(arguments);
+        }];
+        this.callParent(arguments);
     }
 });

http://lada.wald.intevation.org