comparison app/view/orte/List.js @ 496:d07e5086a64b

Moved stammdaten stores to app.js and load them via storemanager.
author Raimund Renkert <raimund.renkert@intevation.de>
date Thu, 06 Nov 2014 10:35:35 +0100
parents 850ccfe5f3c4
children 7c0653e8d9f7
comparison
equal deleted inserted replaced
495:649bf1d08531 496:d07e5086a64b
11 */ 11 */
12 Ext.define('Lada.view.orte.List' ,{ 12 Ext.define('Lada.view.orte.List' ,{
13 extend: 'Ext.grid.Panel', 13 extend: 'Ext.grid.Panel',
14 alias: 'widget.ortelist', 14 alias: 'widget.ortelist',
15 15
16 store: 'Orte',
17 viewConfig: { 16 viewConfig: {
18 maxHeight: 350, 17 maxHeight: 350,
19 emptyText: 'Keine Orte gefunden.', 18 emptyText: 'Keine Orte gefunden.',
20 // minHeight and deferEmptyText are needed to be able to show the 19 // minHeight and deferEmptyText are needed to be able to show the
21 // emptyText message. 20 // emptyText message.
49 dataIndex: 'ortsTyp' 48 dataIndex: 'ortsTyp'
50 }, { 49 }, {
51 header: 'Staat', 50 header: 'Staat',
52 dataIndex: 'ortId', 51 dataIndex: 'ortId',
53 renderer: function(value) { 52 renderer: function(value) {
54 var store = Ext.getStore('StaOrte'); 53 var store = Ext.data.StoreManager.get('staOrte');
55 var staaten = Ext.getStore('StaStaaten'); 54 var staaten = Ext.data.StoreManager.get('staStaaten');
56 console.log('staatenstore: ' + staaten); 55 var record =
57 console.log('the staat: ' + store.getById(value).get("staatId")); 56 staaten.getById(store.getById(value).get('staatId'));
58 var record = staaten.getById(store.getById(value).get('staatId'));
59 return record.get('staatIso'); 57 return record.get('staatIso');
60 } 58 }
61 }, { 59 }, {
62 header: 'Gemeineschlüssel', 60 header: 'Gemeineschlüssel',
63 dataIndex: 'ortId', 61 dataIndex: 'ortId',
64 renderer: function(value) { 62 renderer: function(value) {
65 var store = Ext.getStore('StaOrte'); 63 var store = Ext.data.StoreManager.get('staOrte');
66 console.log('value ' + value); 64 console.log('value ' + value);
67 var record = store.getById(value); 65 var record = store.getById(value);
68 return record.get('gemId'); 66 return record.get('gemId');
69 } 67 }
70 }, { 68 }, {
71 header: 'Gemeindename', 69 header: 'Gemeindename',
72 dataIndex: 'ortId', 70 dataIndex: 'ortId',
73 flex: 1, 71 flex: 1,
74 renderer: function(value) { 72 renderer: function(value) {
75 var store = Ext.getStore('StaOrte'); 73 var store = Ext.data.StoreManager.get('staOrte');
76 var gemeinden = Ext.getStore('StaVerwaltungseinheiten'); 74 var gemeinden =
75 Ext.data.StoreManager.get('staVerwaltungseinheiten');
77 var record = store.getById(value); 76 var record = store.getById(value);
78 var gemid = record.get('gemId'); 77 var gemid = record.get('gemId');
79 var record2 = gemeinden.getById(gemid); 78 var record2 = gemeinden.getById(gemid);
80 return record2.get('bezeichnung'); 79 return record2.get('bezeichnung');
81 } 80 }
82 }, { 81 }, {
83 header: 'Messpunkt', 82 header: 'Messpunkt',
84 dataIndex: 'ortId', 83 dataIndex: 'ortId',
85 renderer: function(value) { 84 renderer: function(value) {
86 var store = Ext.getStore('StaOrte'); 85 var store = Ext.getStore('staOrte');
87 var record = store.getById(value); 86 var record = store.getById(value);
88 return record.get('bezeichnung'); 87 return record.get('bezeichnung');
89 } 88 }
90 }]; 89 }];
91 this.callParent(arguments); 90 this.callParent(arguments);

http://lada.wald.intevation.org