comparison app/view/widgets/Mst.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 mstStore = Ext.create('Ext.data.Store', {
10 fields: ['mstId', 'messStelle'],
11 sorters: [{
12 property: 'messStelle'
13 }],
14 autoLoad: true,
15 proxy: {
16 type: 'ajax',
17 api: {
18 read: 'server/rest/mst'
19 },
20 reader: {
21 type: 'json',
22 root: 'data'
23 }
24 }
25 });
26
27 /** 9 /**
28 * Combobox for Messstelle 10 * Combobox for Messstelle
29 */ 11 */
30 Ext.define('Lada.view.widgets.Mst' ,{ 12 Ext.define('Lada.view.widgets.Mst' ,{
31 extend: 'Ext.form.ComboBox', 13 extend: 'Ext.form.ComboBox',
32 alias: 'widget.mst', 14 require: ['Lada.store.StaMessstellen'],
33 store: mstStore, 15 alias: 'widget.mst',
34 displayField:'messStelle', 16 store: 'StaMessstellen',
35 valueField: 'mstId', 17 displayField:'messStelle',
36 typeAhead: false, 18 valueField: 'id',
37 emptyText:'Wählen Sie eine Messstelle', 19 typeAhead: false,
38 // Enable filtering of comboboxes 20 emptyText:'Wählen Sie eine Messstelle',
39 autoSelect: false, 21 // Enable filtering of comboboxes
40 queryMode: 'local', 22 autoSelect: false,
41 triggerAction : 'all', 23 queryMode: 'local',
42 typeAhead: false, 24 triggerAction : 'all',
43 minChars: 0, 25 typeAhead: false,
26 minChars: 0,
44 initComponent: function() { 27 initComponent: function() {
28 this.store = Ext.data.StoreManager.get('StaMessstellen');
29 if (!this.store) {
30 this.store = Ext.create('Lada.store.StaMessstellen');
31 }
45 this.callParent(arguments); 32 this.callParent(arguments);
46 } 33 }
47 }); 34 });

http://lada.wald.intevation.org