annotate app/view/widgets/Verwaltungseinheit.js @ 524:8972f008dfb1

Make tables editable for 'MKommentare' See LSB 3.5
author Roland Geider <roland.geider@intevation.de>
date Tue, 16 Dec 2014 16:20:42 +0100
parents c1b77fb96b01
children
rev   line source
472
debfcc7713e3 Added license header to each file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 428
diff changeset
1 /* Copyright (C) 2013 by Bundesamt fuer Strahlenschutz
debfcc7713e3 Added license header to each file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 428
diff changeset
2 * Software engineering by Intevation GmbH
debfcc7713e3 Added license header to each file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 428
diff changeset
3 *
debfcc7713e3 Added license header to each file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 428
diff changeset
4 * This file is Free Software under the GNU GPL (v>=3)
debfcc7713e3 Added license header to each file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 428
diff changeset
5 * and comes with ABSOLUTELY NO WARRANTY! Check out
497
7c0653e8d9f7 Fixed some js related issues (unused vars, arrays, etc.) and code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 490
diff changeset
6 * the documentation coming with IMIS-Labordaten-Application for details.
472
debfcc7713e3 Added license header to each file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 428
diff changeset
7 */
debfcc7713e3 Added license header to each file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 428
diff changeset
8
352
5fbcbf330839 Added documenation
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 153
diff changeset
9 /**
5fbcbf330839 Added documenation
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 153
diff changeset
10 * Combobox for Verwaltungseinheit
5fbcbf330839 Added documenation
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 153
diff changeset
11 */
497
7c0653e8d9f7 Fixed some js related issues (unused vars, arrays, etc.) and code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 490
diff changeset
12 Ext.define('Lada.view.widgets.Verwaltungseinheit', {
490
446e99cfd425 Updated views and controllers using the new model and stores.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 481
diff changeset
13 extend: 'Ext.form.field.ComboBox',
446e99cfd425 Updated views and controllers using the new model and stores.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 481
diff changeset
14 alias: 'widget.verwaltungseinheiten',
446e99cfd425 Updated views and controllers using the new model and stores.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 481
diff changeset
15 store: 'StaVerwaltungseinheiten',
446e99cfd425 Updated views and controllers using the new model and stores.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 481
diff changeset
16 displayField: 'bezeichnung',
446e99cfd425 Updated views and controllers using the new model and stores.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 481
diff changeset
17 valueField: 'id',
497
7c0653e8d9f7 Fixed some js related issues (unused vars, arrays, etc.) and code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 490
diff changeset
18 emptyText: 'Wählen Sie eine Verwaltungseinheit',
490
446e99cfd425 Updated views and controllers using the new model and stores.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 481
diff changeset
19 hideTrigger: true,
446e99cfd425 Updated views and controllers using the new model and stores.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 481
diff changeset
20 // Enable filtering of comboboxes
446e99cfd425 Updated views and controllers using the new model and stores.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 481
diff changeset
21 autoSelect: false,
446e99cfd425 Updated views and controllers using the new model and stores.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 481
diff changeset
22 queryMode: 'remote',
497
7c0653e8d9f7 Fixed some js related issues (unused vars, arrays, etc.) and code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 490
diff changeset
23 triggerAction: 'type',
490
446e99cfd425 Updated views and controllers using the new model and stores.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 481
diff changeset
24 typeAhead: false,
446e99cfd425 Updated views and controllers using the new model and stores.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 481
diff changeset
25 minChars: 2,
446e99cfd425 Updated views and controllers using the new model and stores.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 481
diff changeset
26
153
e9fb4814153a Added files for Staat, Ort and Verwaltungseinheiten.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
27 initComponent: function() {
490
446e99cfd425 Updated views and controllers using the new model and stores.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 481
diff changeset
28 this.store = Ext.data.StoreManager.get('StaVerwaltungseinheiten');
446e99cfd425 Updated views and controllers using the new model and stores.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 481
diff changeset
29 if (!this.store) {
446e99cfd425 Updated views and controllers using the new model and stores.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 481
diff changeset
30 this.store = Ext.create('Lada.store.StaVerwaltungseinheiten');
446e99cfd425 Updated views and controllers using the new model and stores.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 481
diff changeset
31 }
153
e9fb4814153a Added files for Staat, Ort and Verwaltungseinheiten.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
32 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
33 },
651ee49ff3c2 Added listener to load the recored of the set Verwaltungseinheit.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 417
diff changeset
34 // 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
35 // 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
36 // 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
37 listeners: {
497
7c0653e8d9f7 Fixed some js related issues (unused vars, arrays, etc.) and code style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 490
diff changeset
38 render: function(combo) {
428
651ee49ff3c2 Added listener to load the recored of the set Verwaltungseinheit.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 417
diff changeset
39 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
40 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
41 });
651ee49ff3c2 Added listener to load the recored of the set Verwaltungseinheit.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 417
diff changeset
42 }
153
e9fb4814153a Added files for Staat, Ort and Verwaltungseinheiten.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
43 }
e9fb4814153a Added files for Staat, Ort and Verwaltungseinheiten.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
44 });

http://lada.wald.intevation.org