annotate app/view/orte/List.js @ 472:debfcc7713e3

Added license header to each file.
author Torsten Irländer <torsten.irlaender@intevation.de>
date Thu, 16 Jan 2014 17:34:30 +0100
parents 487ae31f4c5d
children 446e99cfd425
rev   line source
472
debfcc7713e3 Added license header to each file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 459
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: 459
diff changeset
2 * Software engineering by Intevation GmbH
debfcc7713e3 Added license header to each file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 459
diff changeset
3 *
debfcc7713e3 Added license header to each file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 459
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: 459
diff changeset
5 * and comes with ABSOLUTELY NO WARRANTY! Check out
debfcc7713e3 Added license header to each file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 459
diff changeset
6 * the documentation coming with IMIS-Labordaten-Application for details.
debfcc7713e3 Added license header to each file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 459
diff changeset
7 */
debfcc7713e3 Added license header to each file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 459
diff changeset
8
347
1536fb5c81b7 Added documentation
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 152
diff changeset
9 /*
1536fb5c81b7 Added documentation
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 152
diff changeset
10 * Grid to list Orte
1536fb5c81b7 Added documentation
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 152
diff changeset
11 */
94
21c069e2ecdb Added Orte to the Proben edit window
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
12 Ext.define('Lada.view.orte.List' ,{
21c069e2ecdb Added Orte to the Proben edit window
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
13 extend: 'Ext.grid.Panel',
21c069e2ecdb Added Orte to the Proben edit window
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
14 alias: 'widget.ortelist',
21c069e2ecdb Added Orte to the Proben edit window
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
15 store: 'Orte',
21c069e2ecdb Added Orte to the Proben edit window
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
16 viewConfig: {
21c069e2ecdb Added Orte to the Proben edit window
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
17 maxHeight: 350,
21c069e2ecdb Added Orte to the Proben edit window
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
18 emptyText: 'Keine Orte gefunden.',
21c069e2ecdb Added Orte to the Proben edit window
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
19 // minHeight and deferEmptyText are needed to be able to show the
21c069e2ecdb Added Orte to the Proben edit window
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
20 // emptyText message.
21c069e2ecdb Added Orte to the Proben edit window
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
21 minHeight: 35,
21c069e2ecdb Added Orte to the Proben edit window
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
22 deferEmptyText: false
21c069e2ecdb Added Orte to the Proben edit window
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
23 },
149
26ac4c99f8c4 Added Orte.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 105
diff changeset
24 probeId: null,
94
21c069e2ecdb Added Orte to the Proben edit window
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
25 initComponent: function() {
21c069e2ecdb Added Orte to the Proben edit window
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
26 this.dockedItems = [
21c069e2ecdb Added Orte to the Proben edit window
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
27 {
21c069e2ecdb Added Orte to the Proben edit window
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
28 xtype: 'toolbar',
21c069e2ecdb Added Orte to the Proben edit window
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
29 dock: 'top',
21c069e2ecdb Added Orte to the Proben edit window
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
30 items: [
21c069e2ecdb Added Orte to the Proben edit window
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
31 {
21c069e2ecdb Added Orte to the Proben edit window
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
32 text: 'Hinzufügen',
391
d1bb925bb5f5 Use the new icons in list views and status bar.
Raimund Renkert <rrenkert@intevation.de>
parents: 347
diff changeset
33 icon: 'gfx/list-add.png',
149
26ac4c99f8c4 Added Orte.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 105
diff changeset
34 action: 'add',
26ac4c99f8c4 Added Orte.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 105
diff changeset
35 probeId: this.probeId
94
21c069e2ecdb Added Orte to the Proben edit window
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
36 },
21c069e2ecdb Added Orte to the Proben edit window
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
37 {
21c069e2ecdb Added Orte to the Proben edit window
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
38 text: 'Löschen',
391
d1bb925bb5f5 Use the new icons in list views and status bar.
Raimund Renkert <rrenkert@intevation.de>
parents: 347
diff changeset
39 icon: 'gfx/list-remove.png',
94
21c069e2ecdb Added Orte to the Proben edit window
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
40 action: 'delete'
21c069e2ecdb Added Orte to the Proben edit window
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
41 }
21c069e2ecdb Added Orte to the Proben edit window
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
42 ]
21c069e2ecdb Added Orte to the Proben edit window
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
43 }
21c069e2ecdb Added Orte to the Proben edit window
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
44 ];
21c069e2ecdb Added Orte to the Proben edit window
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
45 this.columns = [
149
26ac4c99f8c4 Added Orte.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 105
diff changeset
46 {
26ac4c99f8c4 Added Orte.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 105
diff changeset
47 header: 'Typ',
456
683b8a3010cc Show ortsType of Ort, and not otyp of ortedetail in orte listing.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 424
diff changeset
48 dataIndex: 'ortsTyp'
149
26ac4c99f8c4 Added Orte.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 105
diff changeset
49 },
26ac4c99f8c4 Added Orte.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 105
diff changeset
50 {
26ac4c99f8c4 Added Orte.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 105
diff changeset
51 header: 'Staat',
26ac4c99f8c4 Added Orte.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 105
diff changeset
52 dataIndex: 'ortId',
26ac4c99f8c4 Added Orte.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 105
diff changeset
53 renderer: function(value) {
26ac4c99f8c4 Added Orte.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 105
diff changeset
54 var store = Ext.getStore('Ortedetails');
26ac4c99f8c4 Added Orte.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 105
diff changeset
55 var staaten = Ext.getStore('Staaten');
26ac4c99f8c4 Added Orte.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 105
diff changeset
56 var record = staaten.getById(store.getById(value).get('staatId'));
26ac4c99f8c4 Added Orte.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 105
diff changeset
57 return record.get('staatIso');
26ac4c99f8c4 Added Orte.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 105
diff changeset
58 }
26ac4c99f8c4 Added Orte.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 105
diff changeset
59
26ac4c99f8c4 Added Orte.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 105
diff changeset
60 },
26ac4c99f8c4 Added Orte.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 105
diff changeset
61 {
458
29e325b91f47 Renamed field Gem-Id to Gemeindeschlüssel
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 456
diff changeset
62 header: 'Gemeineschlüssel',
149
26ac4c99f8c4 Added Orte.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 105
diff changeset
63 dataIndex: 'ortId',
26ac4c99f8c4 Added Orte.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 105
diff changeset
64 renderer: function(value) {
26ac4c99f8c4 Added Orte.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 105
diff changeset
65 var store = Ext.getStore('Ortedetails');
26ac4c99f8c4 Added Orte.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 105
diff changeset
66 var record = store.getById(value);
26ac4c99f8c4 Added Orte.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 105
diff changeset
67 return record.get('gemId');
26ac4c99f8c4 Added Orte.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 105
diff changeset
68 }
26ac4c99f8c4 Added Orte.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 105
diff changeset
69
26ac4c99f8c4 Added Orte.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 105
diff changeset
70 },
26ac4c99f8c4 Added Orte.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 105
diff changeset
71 {
459
487ae31f4c5d Added new Field Gemeindename
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 458
diff changeset
72 header: 'Gemeindename',
149
26ac4c99f8c4 Added Orte.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 105
diff changeset
73 dataIndex: 'ortId',
26ac4c99f8c4 Added Orte.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 105
diff changeset
74 flex: 1,
26ac4c99f8c4 Added Orte.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 105
diff changeset
75 renderer: function(value) {
26ac4c99f8c4 Added Orte.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 105
diff changeset
76 var store = Ext.getStore('Ortedetails');
459
487ae31f4c5d Added new Field Gemeindename
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 458
diff changeset
77 var gemeinden = Ext.getStore('Verwaltungseinheiten');
424
9c44ce52a33c Fix rendering of the orte list. Some fields was not shown because of wrong
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 391
diff changeset
78 var record = store.getById(value);
459
487ae31f4c5d Added new Field Gemeindename
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 458
diff changeset
79 var gemid = record.get('gemId');
487ae31f4c5d Added new Field Gemeindename
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 458
diff changeset
80 var record2 = gemeinden.findRecord("gemId", gemid);
487ae31f4c5d Added new Field Gemeindename
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 458
diff changeset
81 return record2.get('bezeichnung');
149
26ac4c99f8c4 Added Orte.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 105
diff changeset
82 }
26ac4c99f8c4 Added Orte.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 105
diff changeset
83
26ac4c99f8c4 Added Orte.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 105
diff changeset
84 },
26ac4c99f8c4 Added Orte.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 105
diff changeset
85 {
26ac4c99f8c4 Added Orte.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 105
diff changeset
86 header: 'Messpunkt',
26ac4c99f8c4 Added Orte.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 105
diff changeset
87 dataIndex: 'ortId',
26ac4c99f8c4 Added Orte.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 105
diff changeset
88 renderer: function(value) {
152
30aae7295cd0 Return korrekt Messpunkt
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 151
diff changeset
89 var store = Ext.getStore('Ortedetails');
30aae7295cd0 Return korrekt Messpunkt
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 151
diff changeset
90 var record = store.getById(value);
30aae7295cd0 Return korrekt Messpunkt
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 151
diff changeset
91 return record.get('bezeichnung');
149
26ac4c99f8c4 Added Orte.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 105
diff changeset
92 }
26ac4c99f8c4 Added Orte.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 105
diff changeset
93
26ac4c99f8c4 Added Orte.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 105
diff changeset
94 }
94
21c069e2ecdb Added Orte to the Proben edit window
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
95 ];
21c069e2ecdb Added Orte to the Proben edit window
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
96 this.callParent(arguments);
21c069e2ecdb Added Orte to the Proben edit window
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
97 }
21c069e2ecdb Added Orte to the Proben edit window
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
98 });
21c069e2ecdb Added Orte to the Proben edit window
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
99

http://lada.wald.intevation.org