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