comparison app/view/widgets/Datenbasis.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 d07e5086a64b
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 datenbasisStore = Ext.create('Ext.data.Store', {
10 fields: ['datenbasisId', 'beschreibung', 'datenbasis'],
11 sorters: [{
12 property: 'datenbasis'
13 }],
14 autoLoad: true,
15 proxy: {
16 type: 'ajax',
17 api: {
18 read: 'server/rest/datenbasis'
19 },
20 reader: {
21 type: 'json',
22 root: 'data'
23 }
24 }
25 });
26
27 /** 9 /**
28 * Combobox for Datenbasis 10 * Combobox for Datenbasis
29 */ 11 */
30 Ext.define('Lada.view.widgets.Datenbasis' ,{ 12 Ext.define('Lada.view.widgets.Datenbasis' ,{
31 extend: 'Ext.form.ComboBox', 13 extend: 'Ext.form.ComboBox',
32 alias: 'widget.datenbasis', 14 require: ['Lada.store.StaDatenbasen'],
33 store: datenbasisStore, 15 alias: 'widget.datenbasis',
34 displayField:'datenbasis', 16 store: 'StaDatenbasen',
35 valueField: 'datenbasisId', 17 displayField:'datenbasis',
36 emptyText:'Wählen Sie eine Datenbasis', 18 valueField: 'id',
37 // Enable filtering of comboboxes 19 emptyText:'Wählen Sie eine Datenbasis',
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,
26
43 initComponent: function() { 27 initComponent: function() {
28 this.store = Ext.data.StoreManager.get('StaDatenbasen');
29 if (!this.store) {
30 this.store = Ext.create('Lada.store.StaDatenbasen');
31 }
44 this.callParent(arguments); 32 this.callParent(arguments);
45 } 33 }
46 }); 34 });

http://lada.wald.intevation.org