comparison app/view/orte/List.js @ 491:850ccfe5f3c4

Code style.
author Raimund Renkert <raimund.renkert@intevation.de>
date Fri, 31 Oct 2014 23:23:32 +0100
parents 446e99cfd425
children d07e5086a64b
comparison
equal deleted inserted replaced
490:446e99cfd425 491:850ccfe5f3c4
10 * Grid to list Orte 10 * Grid to list Orte
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 store: 'Orte', 16 store: 'Orte',
16 viewConfig: { 17 viewConfig: {
17 maxHeight: 350, 18 maxHeight: 350,
18 emptyText: 'Keine Orte gefunden.', 19 emptyText: 'Keine Orte gefunden.',
19 // minHeight and deferEmptyText are needed to be able to show the 20 // minHeight and deferEmptyText are needed to be able to show the
20 // emptyText message. 21 // emptyText message.
21 minHeight: 35, 22 minHeight: 35,
22 deferEmptyText: false 23 deferEmptyText: false
23 }, 24 },
25
24 probeId: null, 26 probeId: null,
27
25 initComponent: function() { 28 initComponent: function() {
26 this.store = Ext.data.StoreManager.get('Orte'); 29 this.store = Ext.data.StoreManager.get('Orte');
27 if (!this.store) { 30 if (!this.store) {
28 this.store = Ext.create('Lada.store.Orte'); 31 this.store = Ext.create('Lada.store.Orte');
29 } 32 }
30 this.dockedItems = [ 33 this.dockedItems = [{
31 { 34 xtype: 'toolbar',
32 xtype: 'toolbar', 35 dock: 'top',
33 dock: 'top', 36 items: [{
34 items: [ 37 text: 'Hinzufügen',
35 { 38 icon: 'gfx/list-add.png',
36 text: 'Hinzufügen', 39 action: 'add',
37 icon: 'gfx/list-add.png', 40 probeId: this.probeId
38 action: 'add', 41 }, {
39 probeId: this.probeId 42 text: 'Löschen',
40 }, 43 icon: 'gfx/list-remove.png',
41 { 44 action: 'delete'
42 text: 'Löschen', 45 }]
43 icon: 'gfx/list-remove.png', 46 }];
44 action: 'delete' 47 this.columns = [{
45 } 48 header: 'Typ',
46 ] 49 dataIndex: 'ortsTyp'
50 }, {
51 header: 'Staat',
52 dataIndex: 'ortId',
53 renderer: function(value) {
54 var store = Ext.getStore('StaOrte');
55 var staaten = Ext.getStore('StaStaaten');
56 console.log('staatenstore: ' + staaten);
57 console.log('the staat: ' + store.getById(value).get("staatId"));
58 var record = staaten.getById(store.getById(value).get('staatId'));
59 return record.get('staatIso');
47 } 60 }
48 ]; 61 }, {
49 this.columns = [ 62 header: 'Gemeineschlüssel',
50 { 63 dataIndex: 'ortId',
51 header: 'Typ', 64 renderer: function(value) {
52 dataIndex: 'ortsTyp' 65 var store = Ext.getStore('StaOrte');
53 }, 66 console.log('value ' + value);
54 { 67 var record = store.getById(value);
55 header: 'Staat', 68 return record.get('gemId');
56 dataIndex: 'ortId',
57 renderer: function(value) {
58 var store = Ext.getStore('StaOrte');
59 var staaten = Ext.getStore('StaStaaten');
60 console.log('staatenstore: ' + staaten);
61 console.log('the staat: ' + store.getById(value).get("staatId"));
62 var record = staaten.getById(store.getById(value).get('staatId'));
63 return record.get('staatIso');
64 }
65
66 },
67 {
68 header: 'Gemeineschlüssel',
69 dataIndex: 'ortId',
70 renderer: function(value) {
71 var store = Ext.getStore('StaOrte');
72 console.log('value ' + value);
73 var record = store.getById(value);
74 return record.get('gemId');
75 }
76
77 },
78 {
79 header: 'Gemeindename',
80 dataIndex: 'ortId',
81 flex: 1,
82 renderer: function(value) {
83 var store = Ext.getStore('StaOrte');
84 var gemeinden = Ext.getStore('StaVerwaltungseinheiten');
85 var record = store.getById(value);
86 var gemid = record.get('gemId');
87 var record2 = gemeinden.getById(gemid);
88 return record2.get('bezeichnung');
89 }
90
91 },
92 {
93 header: 'Messpunkt',
94 dataIndex: 'ortId',
95 renderer: function(value) {
96 var store = Ext.getStore('StaOrte');
97 var record = store.getById(value);
98 return record.get('bezeichnung');
99 }
100
101 } 69 }
102 ]; 70 }, {
71 header: 'Gemeindename',
72 dataIndex: 'ortId',
73 flex: 1,
74 renderer: function(value) {
75 var store = Ext.getStore('StaOrte');
76 var gemeinden = Ext.getStore('StaVerwaltungseinheiten');
77 var record = store.getById(value);
78 var gemid = record.get('gemId');
79 var record2 = gemeinden.getById(gemid);
80 return record2.get('bezeichnung');
81 }
82 }, {
83 header: 'Messpunkt',
84 dataIndex: 'ortId',
85 renderer: function(value) {
86 var store = Ext.getStore('StaOrte');
87 var record = store.getById(value);
88 return record.get('bezeichnung');
89 }
90 }];
103 this.callParent(arguments); 91 this.callParent(arguments);
104 } 92 }
105 }); 93 });
106 94

http://lada.wald.intevation.org