dustin@747: /* Copyright (C) 2013 by Bundesamt fuer Strahlenschutz dustin@747: * Software engineering by Intevation GmbH dustin@747: * dustin@747: * This file is Free Software under the GNU GPL (v>=3) dustin@747: * and comes with ABSOLUTELY NO WARRANTY! Check out dustin@747: * the documentation coming with IMIS-Labordaten-Application for details. dustin@747: */ dustin@747: dustin@747: /** dustin@978: * This is a Widget for a ModeSwitcher dustin@747: */ dustin@978: Ext.define('Lada.view.ModeSwitcher', { dustin@751: extend: 'Ext.form.FieldSet', dustin@978: alias: 'widget.modeswitcher', dustin@747: dustin@747: mixins: { dustin@747: observable: 'Ext.util.Observable' dustin@747: }, dustin@747: /** dustin@747: * Initialise the Widget. dustin@747: * When the Checkbox is checked, it fires a 'check' Event dustin@747: */ dustin@747: initComponent: function() { dustin@751: var i18n = Lada.getApplication().bundle; dustin@751: this.title = i18n.getMsg('modus'); raimund@1077: this.items = [{ dustin@751: xtype: 'radiogroup', dustin@751: columns: 1, dustin@751: width: '100%', dustin@747: items: [{ dustin@751: xtype: 'radiofield', dustin@978: name: 'modeswitch', dustin@975: boxLabel: i18n.getMsg('proben'), dustin@975: inputValue: 'proben', //this determines the store dustin@975: // which will be loaded by the controller, dustin@794: checked: true, raimund@1077: handler: function(field, state) { dustin@751: if (state === true) { dustin@751: this.fireEvent('check', field); dustin@747: } dustin@751: } raimund@1077: }, { raimund@1077: xtype: 'radiofield', raimund@1077: name: 'modeswitch', raimund@1077: boxLabel: i18n.getMsg('messungen'), raimund@1077: inputValue: 'messungen', //this determines the store raimund@1077: // which will be loaded by the controller, raimund@1077: handler: function(field, state) { raimund@1077: if (state === true) { raimund@1077: this.fireEvent('check', field); raimund@1077: } raimund@1077: } raimund@1077: }, { dustin@751: xtype: 'radiofield', dustin@978: name: 'modeswitch', dustin@975: boxLabel: i18n.getMsg('messprogramme'), dustin@975: inputValue: 'messprogramme', raimund@1077: handler: function(field, state) { dustin@975: if (state === true) { dustin@975: this.fireEvent('check', field); dustin@975: } dustin@975: } raimund@1077: }, { dustin@975: xtype: 'radiofield', dustin@978: name: 'modeswitch', dustin@975: boxLabel: i18n.getMsg('stammdaten'), dustin@975: inputValue: 'stammdaten', raimund@1077: handler: function(field, state) { dustin@751: if (state === true) { dustin@751: this.fireEvent('check', field); dustin@747: } dustin@751: } dustin@747: }] dustin@751: }]; dustin@751: this.callParent(arguments); dustin@747: } dustin@747: });