comparison app/view/widgets/Uwb.js @ 497:7c0653e8d9f7

Fixed some js related issues (unused vars, arrays, etc.) and code style.
author Raimund Renkert <raimund.renkert@intevation.de>
date Thu, 06 Nov 2014 10:38:17 +0100
parents d07e5086a64b
children c1b77fb96b01
comparison
equal deleted inserted replaced
496:d07e5086a64b 497:7c0653e8d9f7
1 /* Copyright (C) 2013 by Bundesamt fuer Strahlenschutz 1 /* Copyright (C) 2013 by Bundesamt fuer Strahlenschutz
2 * Software engineering by Intevation GmbH 2 * Software engineering by Intevation GmbH
3 * 3 *
4 * This file is Free Software under the GNU GPL (v>=3) 4 * This file is Free Software under the GNU GPL (v>=3)
5 * and comes with ABSOLUTELY NO WARRANTY! Check out 5 * and comes with ABSOLUTELY NO WARRANTY! Check out
6 * the documentation coming with IMIS-Labordaten-Application for details. 6 * the documentation coming with IMIS-Labordaten-Application for details.
7 */ 7 */
8 8
9 /** 9 /**
10 * Combobox for Umweltbereich 10 * Combobox for Umweltbereich
11 */ 11 */
12 Ext.define('Lada.view.widgets.Uwb' ,{ 12 Ext.define('Lada.view.widgets.Uwb' ,{
13 extend: 'Ext.form.ComboBox', 13 extend: 'Ext.form.ComboBox',
14 require: ['Lada.store.StaUmwelt'], 14 require: ['Lada.store.StaUmwelt'],
15 alias: 'widget.uwb', 15 alias: 'widget.uwb',
16 store: 'StaUmwelt', 16 store: 'StaUmwelt',
17 displayField:'id', 17 displayField: 'id',
18 valueField: 'id', 18 valueField: 'id',
19 emptyText:'Wählen Sie einen Umweltbereich', 19 emptyText: 'Wählen Sie einen Umweltbereich',
20 // Enable filtering of comboboxes 20 // Enable filtering of comboboxes
21 autoSelect: false, 21 autoSelect: false,
22 queryMode: 'local', 22 queryMode: 'local',
23 triggerAction : 'all', 23 triggerAction: 'all',
24 typeAhead: false, 24 typeAhead: false,
25 minChars: 0, 25 minChars: 0,
26 tpl: '<tpl for="."><div class="x-combo-list-item x-boundlist-item" >{id} - {umweltBereich}</div></tpl>', 26 tpl: '<tpl for="."><div class="x-combo-list-item x-boundlist-item" >' +
27 '{id} - {umweltBereich}</div></tpl>',
27 // TODO: Set value in disply after selection. Can not figure out why 28 // 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 // accessing the recored.data attribute fails here (ti) <2013-08-06 16:52>
29 //listeners: { 30 // listeners: {
30 // select: function(combo, record, index) { 31 // select: function(combo, record, index) {
31 // console.log("1"); 32 // console.log("1");
32 // console.log(record); 33 // console.log(record);
33 // console.log("2"); 34 // console.log("2");
34 // var text = record.data['umwId'] + " - " + record.data['umweltBereich']; 35 // var text = record.data['umwId'] +
35 // console.log("3"); 36 // " - " + record.data['umweltBereich'];
36 // Ext.form.ComboBox.superclass.setValue.call(this, text); 37 // console.log("3");
37 // combo.value = record.id; 38 // Ext.form.ComboBox.superclass.setValue.call(this, text);
38 // } 39 // combo.value = record.id;
39 //}, 40 // }
41 // },
40 42
41 initComponent: function() { 43 initComponent: function() {
42 this.store = Ext.data.StoreManager.get('staUmwelt'); 44 this.store = Ext.data.StoreManager.get('staUmwelt');
43 if (!this.store) { 45 if (!this.store) {
44 this.store = Ext.create('Lada.store.StaUmwelt'); 46 this.store = Ext.create('Lada.store.StaUmwelt');

http://lada.wald.intevation.org