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 raimund@497: * the documentation coming with IMIS-Labordaten-Application for details. torsten@472: */ torsten@472: torsten@352: /** torsten@352: * Combobox for Umweltbereich torsten@352: */ torsten@31: Ext.define('Lada.view.widgets.Uwb' ,{ raimund@490: extend: 'Ext.form.ComboBox', raimund@490: alias: 'widget.uwb', raimund@490: store: 'StaUmwelt', raimund@497: displayField: 'id', raimund@490: valueField: 'id', raimund@497: emptyText: 'Wählen Sie einen Umweltbereich', raimund@490: // Enable filtering of comboboxes raimund@490: autoSelect: false, raimund@490: queryMode: 'local', raimund@497: triggerAction: 'all', raimund@490: typeAhead: false, raimund@490: minChars: 0, raimund@497: tpl: '
' + raimund@497: '{id} - {umweltBereich}
', raimund@490: // TODO: Set value in disply after selection. Can not figure out why raimund@497: // accessing the recored.data attribute fails here (ti) <2013-08-06 16:52> raimund@497: // listeners: { raimund@497: // select: function(combo, record, index) { raimund@497: // console.log("1"); raimund@497: // console.log(record); raimund@497: // console.log("2"); raimund@497: // var text = record.data['umwId'] + raimund@497: // " - " + record.data['umweltBereich']; raimund@497: // console.log("3"); raimund@497: // Ext.form.ComboBox.superclass.setValue.call(this, text); raimund@497: // combo.value = record.id; raimund@497: // } raimund@497: // }, raimund@491: torsten@31: initComponent: function() { raimund@496: this.store = Ext.data.StoreManager.get('staUmwelt'); raimund@490: if (!this.store) { raimund@490: this.store = Ext.create('Lada.store.StaUmwelt'); raimund@490: } torsten@31: this.callParent(arguments); torsten@31: } torsten@31: });