annotate app/view/widgets/Verwaltungseinheit.js @ 457:e7fea42c1432

Autoload Verwaltungseinheiten. We need the store already load on orte listing.
author Torsten Irländer <torsten.irlaender@intevation.de>
date Wed, 18 Dec 2013 11:45:53 +0100
parents 651ee49ff3c2
children debfcc7713e3
rev   line source
352
5fbcbf330839 Added documenation
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 153
diff changeset
1 /**
5fbcbf330839 Added documenation
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 153
diff changeset
2 * Combobox for Verwaltungseinheit
5fbcbf330839 Added documenation
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 153
diff changeset
3 */
153
e9fb4814153a Added files for Staat, Ort and Verwaltungseinheiten.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
4 Ext.define('Lada.view.widgets.Verwaltungseinheit' ,{
e9fb4814153a Added files for Staat, Ort and Verwaltungseinheiten.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
5 extend: 'Ext.form.ComboBox',
e9fb4814153a Added files for Staat, Ort and Verwaltungseinheiten.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
6 alias: 'widget.verwaltungseinheiten',
e9fb4814153a Added files for Staat, Ort and Verwaltungseinheiten.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
7 store: 'Verwaltungseinheiten',
e9fb4814153a Added files for Staat, Ort and Verwaltungseinheiten.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
8 displayField: 'bezeichnung',
e9fb4814153a Added files for Staat, Ort and Verwaltungseinheiten.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
9 valueField: 'gemId',
e9fb4814153a Added files for Staat, Ort and Verwaltungseinheiten.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
10 emptyText:'Wählen Sie eine Verwaltungseinheit',
417
a4eb98a6ea20 Disabled trigger for combobox and request data if two chars typed.
Raimund Renkert <rrenkert@intevation.de>
parents: 416
diff changeset
11 hideTrigger: true,
355
596501c16560 Issue8. Fixed filtering of comboboxes while typing.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 352
diff changeset
12 // Enable filtering of comboboxes
596501c16560 Issue8. Fixed filtering of comboboxes while typing.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 352
diff changeset
13 autoSelect: false,
416
0814c50caa81 Set querymode to remote to only load a subset of items of the
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 355
diff changeset
14 queryMode: 'remote',
417
a4eb98a6ea20 Disabled trigger for combobox and request data if two chars typed.
Raimund Renkert <rrenkert@intevation.de>
parents: 416
diff changeset
15 triggerAction : 'type',
355
596501c16560 Issue8. Fixed filtering of comboboxes while typing.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 352
diff changeset
16 typeAhead: true,
417
a4eb98a6ea20 Disabled trigger for combobox and request data if two chars typed.
Raimund Renkert <rrenkert@intevation.de>
parents: 416
diff changeset
17 minChars: 2,
153
e9fb4814153a Added files for Staat, Ort and Verwaltungseinheiten.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
18 initComponent: function() {
e9fb4814153a Added files for Staat, Ort and Verwaltungseinheiten.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
19 this.callParent(arguments);
428
651ee49ff3c2 Added listener to load the recored of the set Verwaltungseinheit.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 417
diff changeset
20 },
651ee49ff3c2 Added listener to load the recored of the set Verwaltungseinheit.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 417
diff changeset
21 // This listener is used to load currently "selected" verwaltungseinheit.
651ee49ff3c2 Added listener to load the recored of the set Verwaltungseinheit.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 417
diff changeset
22 // This is needed as without having this record the field would only
651ee49ff3c2 Added listener to load the recored of the set Verwaltungseinheit.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 417
diff changeset
23 // display the raw value (id) of the verwaltungseinheit.
651ee49ff3c2 Added listener to load the recored of the set Verwaltungseinheit.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 417
diff changeset
24 listeners: {
651ee49ff3c2 Added listener to load the recored of the set Verwaltungseinheit.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 417
diff changeset
25 render: function(combo, eOpts) {
651ee49ff3c2 Added listener to load the recored of the set Verwaltungseinheit.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 417
diff changeset
26 combo.store.load({
651ee49ff3c2 Added listener to load the recored of the set Verwaltungseinheit.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 417
diff changeset
27 id: this.getValue()
651ee49ff3c2 Added listener to load the recored of the set Verwaltungseinheit.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 417
diff changeset
28 });
651ee49ff3c2 Added listener to load the recored of the set Verwaltungseinheit.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 417
diff changeset
29 }
153
e9fb4814153a Added files for Staat, Ort and Verwaltungseinheiten.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
30 }
e9fb4814153a Added files for Staat, Ort and Verwaltungseinheiten.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
31 });

http://lada.wald.intevation.org