comparison app/view/widget/Umwelt.js @ 738:2db5d54a5685

Fixed ToDo in Umweltbereiche Store, made Umweltbereiche Typable to fix the regression, Sorted Umweltbereiche by ID
author Dustin Demuth <dustin@intevation.de>
date Mon, 20 Apr 2015 12:24:54 +0200
parents 7f11b75e0188
children 6b0d0e62f7d7
comparison
equal deleted inserted replaced
737:4031b9aa8d83 738:2db5d54a5685
14 alias: 'widget.umwelt', 14 alias: 'widget.umwelt',
15 store: 'Umwelt', 15 store: 'Umwelt',
16 displayField: 'id', 16 displayField: 'id',
17 valueField: 'id', 17 valueField: 'id',
18 editable: this.editable || false, 18 editable: this.editable || false,
19 forceSelection: true,
19 emptyText: 'Wählen Sie einen Umweltbereich', 20 emptyText: 'Wählen Sie einen Umweltbereich',
20 // Enable filtering of comboboxes 21 // Enable filtering of comboboxes
21 autoSelect: false, 22 autoSelect: false,
22 queryMode: 'local', 23 queryMode: 'local',
23 triggerAction: 'all', 24 triggerAction: 'all',
24 typeAhead: false, 25 typeAhead: false,
25 minChars: 0, 26 minChars: 0,
26 tpl: '<tpl for="."><div class="x-combo-list-item x-boundlist-item" >' + 27 tpl: Ext.create("Ext.XTemplate",
27 '{id} - {umweltBereich}</div></tpl>', 28 '<tpl for="."><div class="x-combo-list-item x-boundlist-item" >' +
28 // TODO: Set value in disply after selection. Can not figure out why 29 '{id} - {umweltBereich}</div></tpl>'),
29 // accessing the recored.data attribute fails here (ti) <2013-08-06 16:52> 30 displayTpl: Ext.create('Ext.XTemplate',
30 // listeners: { 31 '<tpl for=".">{id} - {umweltBereich}</tpl>'),
31 // select: function(combo, record, index) {
32 // console.log("1");
33 // console.log(record);
34 // console.log("2");
35 // var text = record.data['umwId'] +
36 // " - " + record.data['umweltBereich'];
37 // console.log("3");
38 // Ext.form.ComboBox.superclass.setValue.call(this, text);
39 // combo.value = record.id;
40 // }
41 // },
42 32
43 initComponent: function() { 33 initComponent: function() {
44 this.store = Ext.data.StoreManager.get('umwelt'); 34 this.store = Ext.data.StoreManager.get('umwelt');
45 if (!this.store) { 35 if (!this.store) {
46 this.store = Ext.create('Lada.store.Umwelt'); 36 this.store = Ext.create('Lada.store.Umwelt');
47 } 37 }
38 this.store.sort();
48 this.callParent(arguments); 39 this.callParent(arguments);
49 } 40 }
50 }); 41 });

http://lada.wald.intevation.org