raimund@548: /* Copyright (C) 2013 by Bundesamt fuer Strahlenschutz raimund@548: * Software engineering by Intevation GmbH raimund@548: * raimund@548: * This file is Free Software under the GNU GPL (v>=3) raimund@548: * and comes with ABSOLUTELY NO WARRANTY! Check out raimund@548: * the documentation coming with IMIS-Labordaten-Application for details. raimund@548: */ raimund@548: raimund@548: /** raimund@548: * Combobox for Umweltbereich raimund@548: */ raimund@548: Ext.define('Lada.view.widget.Umwelt' ,{ raimund@548: extend: 'Lada.view.widget.base.ComboBox', raimund@548: alias: 'widget.umwelt', raimund@548: store: 'Umwelt', raimund@548: displayField: 'id', raimund@548: valueField: 'id', raimund@548: emptyText: 'Wählen Sie einen Umweltbereich', raimund@548: // Enable filtering of comboboxes raimund@548: autoSelect: false, raimund@548: queryMode: 'local', raimund@548: triggerAction: 'all', raimund@548: typeAhead: false, raimund@548: minChars: 0, raimund@548: tpl: '
' + raimund@548: '{id} - {umweltBereich}
', raimund@548: // TODO: Set value in disply after selection. Can not figure out why raimund@548: // accessing the recored.data attribute fails here (ti) <2013-08-06 16:52> raimund@548: // listeners: { raimund@548: // select: function(combo, record, index) { raimund@548: // console.log("1"); raimund@548: // console.log(record); raimund@548: // console.log("2"); raimund@548: // var text = record.data['umwId'] + raimund@548: // " - " + record.data['umweltBereich']; raimund@548: // console.log("3"); raimund@548: // Ext.form.ComboBox.superclass.setValue.call(this, text); raimund@548: // combo.value = record.id; raimund@548: // } raimund@548: // }, raimund@548: raimund@548: initComponent: function() { raimund@548: this.store = Ext.data.StoreManager.get('umwelt'); raimund@548: if (!this.store) { raimund@548: this.store = Ext.create('Lada.store.Umwelt'); raimund@548: } raimund@548: this.callParent(arguments); raimund@548: } raimund@548: });