Mercurial > lada > lada-client
annotate app/view/orte/List.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 | 683b8a3010cc |
children | 29e325b91f47 |
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 { |
26ac4c99f8c4
Added Orte.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
105
diff
changeset
|
54 header: 'Gem-ID', |
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 { |
26ac4c99f8c4
Added Orte.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
105
diff
changeset
|
64 header: 'Gemeindebezeichnung', |
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'); |
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
|
69 var record = store.getById(value); |
151
a80e84c934a4
Return correct Gemeindebezeichnung
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
149
diff
changeset
|
70 return record.get('bezeichnung'); |
149
26ac4c99f8c4
Added Orte.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
105
diff
changeset
|
71 } |
26ac4c99f8c4
Added Orte.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
105
diff
changeset
|
72 |
26ac4c99f8c4
Added Orte.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
105
diff
changeset
|
73 }, |
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 header: 'Messpunkt', |
26ac4c99f8c4
Added Orte.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
105
diff
changeset
|
76 dataIndex: 'ortId', |
26ac4c99f8c4
Added Orte.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
105
diff
changeset
|
77 renderer: function(value) { |
152
30aae7295cd0
Return korrekt Messpunkt
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
151
diff
changeset
|
78 var store = Ext.getStore('Ortedetails'); |
30aae7295cd0
Return korrekt Messpunkt
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
151
diff
changeset
|
79 var record = store.getById(value); |
30aae7295cd0
Return korrekt Messpunkt
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
151
diff
changeset
|
80 return record.get('bezeichnung'); |
149
26ac4c99f8c4
Added Orte.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
105
diff
changeset
|
81 } |
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 } |
94
21c069e2ecdb
Added Orte to the Proben edit window
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
84 ]; |
21c069e2ecdb
Added Orte to the Proben edit window
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
85 this.callParent(arguments); |
21c069e2ecdb
Added Orte to the Proben edit window
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
86 } |
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 |