Mercurial > lada > lada-client
annotate app/view/orte/List.js @ 446:b3e806045a5a
New view to create ort details.
author | Raimund Renkert <raimund.renkert@intevation.de> |
---|---|
date | Thu, 05 Dec 2013 09:56:50 +0100 |
parents | 9c44ce52a33c |
children | 683b8a3010cc |
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', |
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
|
40 dataIndex: 'ortId', |
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
|
41 renderer: function(value) { |
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
|
42 var store = Ext.getStore('Ortedetails'); |
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
|
43 var record = store.getById(value); |
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
|
44 return record.get('otyp'); |
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
|
45 } |
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 { |
26ac4c99f8c4
Added Orte.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
105
diff
changeset
|
48 header: 'Staat', |
26ac4c99f8c4
Added Orte.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
105
diff
changeset
|
49 dataIndex: 'ortId', |
26ac4c99f8c4
Added Orte.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
105
diff
changeset
|
50 renderer: function(value) { |
26ac4c99f8c4
Added Orte.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
105
diff
changeset
|
51 var store = Ext.getStore('Ortedetails'); |
26ac4c99f8c4
Added Orte.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
105
diff
changeset
|
52 var staaten = Ext.getStore('Staaten'); |
26ac4c99f8c4
Added Orte.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
105
diff
changeset
|
53 var record = staaten.getById(store.getById(value).get('staatId')); |
26ac4c99f8c4
Added Orte.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
105
diff
changeset
|
54 return record.get('staatIso'); |
26ac4c99f8c4
Added Orte.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
105
diff
changeset
|
55 } |
26ac4c99f8c4
Added Orte.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
105
diff
changeset
|
56 |
26ac4c99f8c4
Added Orte.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
105
diff
changeset
|
57 }, |
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 header: 'Gem-ID', |
26ac4c99f8c4
Added Orte.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
105
diff
changeset
|
60 dataIndex: 'ortId', |
26ac4c99f8c4
Added Orte.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
105
diff
changeset
|
61 renderer: function(value) { |
26ac4c99f8c4
Added Orte.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
105
diff
changeset
|
62 var store = Ext.getStore('Ortedetails'); |
26ac4c99f8c4
Added Orte.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
105
diff
changeset
|
63 var record = store.getById(value); |
26ac4c99f8c4
Added Orte.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
105
diff
changeset
|
64 return record.get('gemId'); |
26ac4c99f8c4
Added Orte.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
105
diff
changeset
|
65 } |
26ac4c99f8c4
Added Orte.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
105
diff
changeset
|
66 |
26ac4c99f8c4
Added Orte.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
105
diff
changeset
|
67 }, |
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 header: 'Gemeindebezeichnung', |
26ac4c99f8c4
Added Orte.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
105
diff
changeset
|
70 dataIndex: 'ortId', |
26ac4c99f8c4
Added Orte.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
105
diff
changeset
|
71 flex: 1, |
26ac4c99f8c4
Added Orte.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
105
diff
changeset
|
72 renderer: function(value) { |
26ac4c99f8c4
Added Orte.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
105
diff
changeset
|
73 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
|
74 var record = store.getById(value); |
151
a80e84c934a4
Return correct Gemeindebezeichnung
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
149
diff
changeset
|
75 return record.get('bezeichnung'); |
149
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 }, |
26ac4c99f8c4
Added Orte.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
105
diff
changeset
|
79 { |
26ac4c99f8c4
Added Orte.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
105
diff
changeset
|
80 header: 'Messpunkt', |
26ac4c99f8c4
Added Orte.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
105
diff
changeset
|
81 dataIndex: 'ortId', |
26ac4c99f8c4
Added Orte.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
105
diff
changeset
|
82 renderer: function(value) { |
152
30aae7295cd0
Return korrekt Messpunkt
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
151
diff
changeset
|
83 var store = Ext.getStore('Ortedetails'); |
30aae7295cd0
Return korrekt Messpunkt
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
151
diff
changeset
|
84 var record = store.getById(value); |
30aae7295cd0
Return korrekt Messpunkt
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
151
diff
changeset
|
85 return record.get('bezeichnung'); |
149
26ac4c99f8c4
Added Orte.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
105
diff
changeset
|
86 } |
26ac4c99f8c4
Added Orte.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
105
diff
changeset
|
87 |
26ac4c99f8c4
Added Orte.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
105
diff
changeset
|
88 } |
94
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 this.callParent(arguments); |
21c069e2ecdb
Added Orte to the Proben edit window
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
91 } |
21c069e2ecdb
Added Orte to the Proben edit window
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
92 }); |
21c069e2ecdb
Added Orte to the Proben edit window
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff
changeset
|
93 |