torsten@472: /* Copyright (C) 2013 by Bundesamt fuer Strahlenschutz torsten@472: * Software engineering by Intevation GmbH torsten@472: * torsten@472: * This file is Free Software under the GNU GPL (v>=3) torsten@472: * and comes with ABSOLUTELY NO WARRANTY! Check out torsten@472: * the documentation coming with IMIS-Labordaten-Application for details. torsten@472: */ torsten@472: torsten@352: /** torsten@352: * Combobox for Verwaltungseinheit torsten@352: */ torsten@153: Ext.define('Lada.view.widgets.Verwaltungseinheit' ,{ raimund@490: extend: 'Ext.form.field.ComboBox', raimund@490: require: ['Lada.store.StaVerwaltungseinheiten'], raimund@490: alias: 'widget.verwaltungseinheiten', raimund@490: store: 'StaVerwaltungseinheiten', raimund@490: displayField: 'bezeichnung', raimund@490: valueField: 'id', raimund@490: emptyText:'Wählen Sie eine Verwaltungseinheit', raimund@490: hideTrigger: true, raimund@490: // Enable filtering of comboboxes raimund@490: autoSelect: false, raimund@490: queryMode: 'remote', raimund@490: triggerAction : 'type', raimund@490: typeAhead: false, raimund@490: minChars: 2, raimund@490: torsten@153: initComponent: function() { raimund@490: this.store = Ext.data.StoreManager.get('StaVerwaltungseinheiten'); raimund@490: if (!this.store) { raimund@490: this.store = Ext.create('Lada.store.StaVerwaltungseinheiten'); raimund@490: } torsten@153: this.callParent(arguments); torsten@428: }, torsten@428: // This listener is used to load currently "selected" verwaltungseinheit. torsten@428: // This is needed as without having this record the field would only torsten@428: // display the raw value (id) of the verwaltungseinheit. torsten@428: listeners: { torsten@428: render: function(combo, eOpts) { torsten@428: combo.store.load({ torsten@428: id: this.getValue() torsten@428: }); torsten@428: } torsten@153: } torsten@153: });