Mercurial > lada > lada-client
comparison app/view/widgets/Verwaltungseinheit.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 | 7c0653e8d9f7 |
comparison
equal
deleted
inserted
replaced
489:6056a7fd9aa2 | 490:446e99cfd425 |
---|---|
8 | 8 |
9 /** | 9 /** |
10 * Combobox for Verwaltungseinheit | 10 * Combobox for Verwaltungseinheit |
11 */ | 11 */ |
12 Ext.define('Lada.view.widgets.Verwaltungseinheit' ,{ | 12 Ext.define('Lada.view.widgets.Verwaltungseinheit' ,{ |
13 extend: 'Ext.form.ComboBox', | 13 extend: 'Ext.form.field.ComboBox', |
14 alias: 'widget.verwaltungseinheiten', | 14 require: ['Lada.store.StaVerwaltungseinheiten'], |
15 store: 'Verwaltungseinheiten', | 15 alias: 'widget.verwaltungseinheiten', |
16 displayField: 'bezeichnung', | 16 store: 'StaVerwaltungseinheiten', |
17 valueField: 'gemId', | 17 displayField: 'bezeichnung', |
18 emptyText:'Wählen Sie eine Verwaltungseinheit', | 18 valueField: 'id', |
19 hideTrigger: true, | 19 emptyText:'Wählen Sie eine Verwaltungseinheit', |
20 // Enable filtering of comboboxes | 20 hideTrigger: true, |
21 autoSelect: false, | 21 // Enable filtering of comboboxes |
22 queryMode: 'remote', | 22 autoSelect: false, |
23 triggerAction : 'type', | 23 queryMode: 'remote', |
24 typeAhead: false, | 24 triggerAction : 'type', |
25 minChars: 2, | 25 typeAhead: false, |
26 minChars: 2, | |
27 | |
26 initComponent: function() { | 28 initComponent: function() { |
29 this.store = Ext.data.StoreManager.get('StaVerwaltungseinheiten'); | |
30 if (!this.store) { | |
31 this.store = Ext.create('Lada.store.StaVerwaltungseinheiten'); | |
32 } | |
27 this.callParent(arguments); | 33 this.callParent(arguments); |
28 }, | 34 }, |
29 // This listener is used to load currently "selected" verwaltungseinheit. | 35 // This listener is used to load currently "selected" verwaltungseinheit. |
30 // This is needed as without having this record the field would only | 36 // This is needed as without having this record the field would only |
31 // display the raw value (id) of the verwaltungseinheit. | 37 // display the raw value (id) of the verwaltungseinheit. |