annotate app/view/orte/List.js @ 460:4e20552b4a3d

Added tag 1.0 for changeset 487ae31f4c5d
author Torsten Irländer <torsten.irlaender@intevation.de>
date Wed, 08 Jan 2014 16:49:16 +0100
parents 487ae31f4c5d
children debfcc7713e3
rev   line source
347
1536fb5c81b7 Added documentation
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 152
diff changeset
1 /*
1536fb5c81b7 Added documentation
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 152
diff changeset
2 * Grid to list Orte
1536fb5c81b7 Added documentation
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 152
diff changeset
3 */
94
21c069e2ecdb Added Orte to the Proben edit window
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
4 Ext.define('Lada.view.orte.List' ,{
21c069e2ecdb Added Orte to the Proben edit window
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
5 extend: 'Ext.grid.Panel',
21c069e2ecdb Added Orte to the Proben edit window
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
6 alias: 'widget.ortelist',
21c069e2ecdb Added Orte to the Proben edit window
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
7 store: 'Orte',
21c069e2ecdb Added Orte to the Proben edit window
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
8 viewConfig: {
21c069e2ecdb Added Orte to the Proben edit window
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
9 maxHeight: 350,
21c069e2ecdb Added Orte to the Proben edit window
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
10 emptyText: 'Keine Orte gefunden.',
21c069e2ecdb Added Orte to the Proben edit window
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
11 // 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
12 // emptyText message.
21c069e2ecdb Added Orte to the Proben edit window
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
13 minHeight: 35,
21c069e2ecdb Added Orte to the Proben edit window
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
14 deferEmptyText: false
21c069e2ecdb Added Orte to the Proben edit window
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
15 },
149
26ac4c99f8c4 Added Orte.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 105
diff changeset
16 probeId: null,
94
21c069e2ecdb Added Orte to the Proben edit window
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
17 initComponent: function() {
21c069e2ecdb Added Orte to the Proben edit window
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
18 this.dockedItems = [
21c069e2ecdb Added Orte to the Proben edit window
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
19 {
21c069e2ecdb Added Orte to the Proben edit window
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
20 xtype: 'toolbar',
21c069e2ecdb Added Orte to the Proben edit window
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
21 dock: 'top',
21c069e2ecdb Added Orte to the Proben edit window
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
22 items: [
21c069e2ecdb Added Orte to the Proben edit window
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
23 {
21c069e2ecdb Added Orte to the Proben edit window
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
24 text: 'Hinzufügen',
391
d1bb925bb5f5 Use the new icons in list views and status bar.
Raimund Renkert <rrenkert@intevation.de>
parents: 347
diff changeset
25 icon: 'gfx/list-add.png',
149
26ac4c99f8c4 Added Orte.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 105
diff changeset
26 action: 'add',
26ac4c99f8c4 Added Orte.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 105
diff changeset
27 probeId: this.probeId
94
21c069e2ecdb Added Orte to the Proben edit window
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
28 },
21c069e2ecdb Added Orte to the Proben edit window
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
29 {
21c069e2ecdb Added Orte to the Proben edit window
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
30 text: 'Löschen',
391
d1bb925bb5f5 Use the new icons in list views and status bar.
Raimund Renkert <rrenkert@intevation.de>
parents: 347
diff changeset
31 icon: 'gfx/list-remove.png',
94
21c069e2ecdb Added Orte to the Proben edit window
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
32 action: 'delete'
21c069e2ecdb Added Orte to the Proben edit window
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
33 }
21c069e2ecdb Added Orte to the Proben edit window
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
34 ]
21c069e2ecdb Added Orte to the Proben edit window
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
35 }
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 this.columns = [
149
26ac4c99f8c4 Added Orte.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 105
diff changeset
38 {
26ac4c99f8c4 Added Orte.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 105
diff changeset
39 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
40 dataIndex: 'ortsTyp'
149
26ac4c99f8c4 Added Orte.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 105
diff changeset
41 },
26ac4c99f8c4 Added Orte.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 105
diff changeset
42 {
26ac4c99f8c4 Added Orte.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 105
diff changeset
43 header: 'Staat',
26ac4c99f8c4 Added Orte.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 105
diff changeset
44 dataIndex: 'ortId',
26ac4c99f8c4 Added Orte.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 105
diff changeset
45 renderer: function(value) {
26ac4c99f8c4 Added Orte.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 105
diff changeset
46 var store = Ext.getStore('Ortedetails');
26ac4c99f8c4 Added Orte.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 105
diff changeset
47 var staaten = Ext.getStore('Staaten');
26ac4c99f8c4 Added Orte.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 105
diff changeset
48 var record = staaten.getById(store.getById(value).get('staatId'));
26ac4c99f8c4 Added Orte.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 105
diff changeset
49 return record.get('staatIso');
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
26ac4c99f8c4 Added Orte.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 105
diff changeset
52 },
26ac4c99f8c4 Added Orte.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 105
diff changeset
53 {
458
29e325b91f47 Renamed field Gem-Id to Gemeindeschlüssel
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 456
diff changeset
54 header: 'Gemeineschlüssel',
149
26ac4c99f8c4 Added Orte.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 105
diff changeset
55 dataIndex: 'ortId',
26ac4c99f8c4 Added Orte.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 105
diff changeset
56 renderer: function(value) {
26ac4c99f8c4 Added Orte.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 105
diff changeset
57 var store = Ext.getStore('Ortedetails');
26ac4c99f8c4 Added Orte.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 105
diff changeset
58 var record = store.getById(value);
26ac4c99f8c4 Added Orte.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 105
diff changeset
59 return record.get('gemId');
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
26ac4c99f8c4 Added Orte.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 105
diff changeset
62 },
26ac4c99f8c4 Added Orte.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 105
diff changeset
63 {
459
487ae31f4c5d Added new Field Gemeindename
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 458
diff changeset
64 header: 'Gemeindename',
149
26ac4c99f8c4 Added Orte.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 105
diff changeset
65 dataIndex: 'ortId',
26ac4c99f8c4 Added Orte.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 105
diff changeset
66 flex: 1,
26ac4c99f8c4 Added Orte.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 105
diff changeset
67 renderer: function(value) {
26ac4c99f8c4 Added Orte.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 105
diff changeset
68 var store = Ext.getStore('Ortedetails');
459
487ae31f4c5d Added new Field Gemeindename
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 458
diff changeset
69 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
70 var record = store.getById(value);
459
487ae31f4c5d Added new Field Gemeindename
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 458
diff changeset
71 var gemid = record.get('gemId');
487ae31f4c5d Added new Field Gemeindename
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 458
diff changeset
72 var record2 = gemeinden.findRecord("gemId", gemid);
487ae31f4c5d Added new Field Gemeindename
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 458
diff changeset
73 return record2.get('bezeichnung');
149
26ac4c99f8c4 Added Orte.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 105
diff changeset
74 }
26ac4c99f8c4 Added Orte.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 105
diff changeset
75
26ac4c99f8c4 Added Orte.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 105
diff changeset
76 },
26ac4c99f8c4 Added Orte.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 105
diff changeset
77 {
26ac4c99f8c4 Added Orte.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 105
diff changeset
78 header: 'Messpunkt',
26ac4c99f8c4 Added Orte.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 105
diff changeset
79 dataIndex: 'ortId',
26ac4c99f8c4 Added Orte.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 105
diff changeset
80 renderer: function(value) {
152
30aae7295cd0 Return korrekt Messpunkt
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 151
diff changeset
81 var store = Ext.getStore('Ortedetails');
30aae7295cd0 Return korrekt Messpunkt
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 151
diff changeset
82 var record = store.getById(value);
30aae7295cd0 Return korrekt Messpunkt
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 151
diff changeset
83 return record.get('bezeichnung');
149
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 }
94
21c069e2ecdb Added Orte to the Proben edit window
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
87 ];
21c069e2ecdb Added Orte to the Proben edit window
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
88 this.callParent(arguments);
21c069e2ecdb Added Orte to the Proben edit window
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
89 }
21c069e2ecdb Added Orte to the Proben edit window
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
90 });
21c069e2ecdb Added Orte to the Proben edit window
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
91

http://lada.wald.intevation.org