diff app/view/ProbenPlanungSwitcher.js @ 747:3ffecbce17d6

Radio-Buttons to switch between query-modes: Probenliste und Probenplanung. Filter-Combobox store wird automatisch gewechselt. ToDo: Query-Store für Probenplanung
author Dustin Demuth <dustin@intevation.de>
date Fri, 24 Apr 2015 15:47:05 +0200
parents
children 704bb359c0fe
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/app/view/ProbenPlanungSwitcher.js	Fri Apr 24 15:47:05 2015 +0200
@@ -0,0 +1,63 @@
+/* Copyright (C) 2013 by Bundesamt fuer Strahlenschutz
+ * Software engineering by Intevation GmbH
+ *
+ * This file is Free Software under the GNU GPL (v>=3)
+ * and comes with ABSOLUTELY NO WARRANTY! Check out
+ * the documentation coming with IMIS-Labordaten-Application for details.
+ */
+
+/**
+ * This is a Widget for a ProbenPlanungSwitcher
+ */
+Ext.define('Lada.view.ProbenPlanungSwitcher', {
+    extend: 'Ext.form.RadioGroup',
+    alias: 'widget.probenplanungswitcher',
+
+    mixins: {
+        observable: 'Ext.util.Observable'
+    },
+    /**
+     * Initialise the Widget.
+     * When the Checkbox is checked, it fires a 'check' Event
+     */
+    initComponent: function() {
+       var i18n = Lada.getApplication().bundle;
+       this.items= [{
+            xtype: 'panel',
+            border: false,
+            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('probeplanning'),
+                    boxLabelAlign: 'before',
+                    inputValue: 'probenplanung',
+                    handler: function(field, state){
+                        if (state === true) {
+                            this.fireEvent('check', field);
+                        }
+                    }
+                 }]
+            }]
+       }];
+       this.callParent(arguments);
+    }
+});

http://lada.wald.intevation.org