comparison app/view/widgets/Uwb.js @ 272:852dc338894e

Make custom comboboxed selectable
author Torsten Irländer <torsten.irlaender@intevation.de>
date Tue, 06 Aug 2013 16:53:47 +0200
parents 1375ff0f248d
children 5fbcbf330839
comparison
equal deleted inserted replaced
271:11f8a2c1b610 272:852dc338894e
15 } 15 }
16 } 16 }
17 }); 17 });
18 18
19 Ext.define('Lada.view.widgets.Uwb' ,{ 19 Ext.define('Lada.view.widgets.Uwb' ,{
20 tpl: '<tpl for="."><div class="x-combo-list-item" >{umwId} - {umweltBereich}</div></tpl>', 20 tpl: '<tpl for="."><div class="x-combo-list-item x-boundlist-item" >{umwId} - {umweltBereich}</div></tpl>',
21 extend: 'Ext.form.ComboBox', 21 extend: 'Ext.form.ComboBox',
22 alias: 'widget.uwb', 22 alias: 'widget.uwb',
23 store: uwbStore, 23 store: uwbStore,
24 displayField:'umwId', 24 displayField:'umwId',
25 valueField: 'umwId', 25 valueField: 'umwId',
26 emptyText:'Wählen Sie einen Umweltbereich', 26 emptyText:'Wählen Sie einen Umweltbereich',
27 // TODO: Set value in disply after selection. Can not figure out why
28 // accessing the recored.data attribute fails here (ti) <2013-08-06 16:52>
29 //listeners: {
30 // select: function(combo, record, index) {
31 // console.log("1");
32 // console.log(record);
33 // console.log("2");
34 // var text = record.data['umwId'] + " - " + record.data['umweltBereich'];
35 // console.log("3");
36 // Ext.form.ComboBox.superclass.setValue.call(this, text);
37 // combo.value = record.id;
38 // }
39 //},
27 initComponent: function() { 40 initComponent: function() {
28 this.callParent(arguments); 41 this.callParent(arguments);
29 } 42 }
30 }); 43 });

http://lada.wald.intevation.org