comparison app/view/widgets/Netzbetreiber.js @ 490:446e99cfd425

Updated views and controllers using the new model and stores.
author Raimund Renkert <raimund.renkert@intevation.de>
date Fri, 31 Oct 2014 21:28:31 +0100
parents e45f4df57938
children 850ccfe5f3c4
comparison
equal deleted inserted replaced
489:6056a7fd9aa2 490:446e99cfd425
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 var netzbetreiberStore = Ext.create('Ext.data.Store', {
10 fields: ['netzbetreiberId', 'netzbetreiber'],
11 sorters: [{
12 property: 'netzbetreiber'
13 }],
14 autoLoad: true,
15 proxy: {
16 type: 'ajax',
17 api: {
18 read: 'server/rest/netzbetreiber'
19 },
20 reader: {
21 type: 'json',
22 root: 'data'
23 }
24 }
25 });
26
27 /** 9 /**
28 * Combobox for Netzbetreiber 10 * Combobox for Netzbetreiber
29 */ 11 */
30 Ext.define('Lada.view.widgets.Netzbetreiber' ,{ 12 Ext.define('Lada.view.widgets.Netzbetreiber' ,{
31 extend: 'Ext.form.ComboBox', 13 extend: 'Ext.form.ComboBox',
32 alias: 'widget.netzbetreiber', 14 require: ['Lada.store.StaNetzbetreiber'],
33 store: netzbetreiberStore, 15 alias: 'widget.netzbetreiber',
34 displayField:'netzbetreiber', 16 store: 'StaNetzbetreiber',
35 valueField: 'netzbetreiberId', 17 displayField:'netzbetreiber',
36 emptyText:'Wählen Sie einen Netzbetreiber', 18 valueField: 'id',
37 // Enable filtering of comboboxes 19 emptyText:'Wählen Sie einen Netzbetreiber',
38 autoSelect: false, 20 // Enable filtering of comboboxes
39 queryMode: 'local', 21 autoSelect: false,
40 triggerAction : 'all', 22 queryMode: 'local',
41 typeAhead: false, 23 triggerAction : 'all',
42 minChars: 0, 24 typeAhead: false,
25 minChars: 0,
43 initComponent: function() { 26 initComponent: function() {
27 this.store = Ext.data.StoreManager.get('StaNetzbetreiber');
28 if (!this.store) {
29 this.store = Ext.create('Lada.store.StaNetzbetreiber');
30 }
44 this.callParent(arguments); 31 this.callParent(arguments);
45 } 32 }
46 }); 33 });
47 34

http://lada.wald.intevation.org