comparison app/view/grid/Ortszuordnung.js @ 1012:2adc329d90fe stammdatengrids

Replaced Locations with Ortszuordnung
author Dustin Demuth <dustin@intevation.de>
date Tue, 26 Jan 2016 10:40:48 +0100
parents 9ac03f461ab4
children 1df6b6210b42
comparison
equal deleted inserted replaced
1011:6afdbc8ee920 1012:2adc329d90fe
9 /** 9 /**
10 * Grid to list Ortszuordnungen 10 * Grid to list Ortszuordnungen
11 */ 11 */
12 Ext.define('Lada.view.grid.Ortszuordnung', { 12 Ext.define('Lada.view.grid.Ortszuordnung', {
13 extend: 'Ext.grid.Panel', 13 extend: 'Ext.grid.Panel',
14 alias: 'widget.ortgrid', 14 alias: 'widget.ortszuordnunggrid',
15 15
16 maxHeight: 350, 16 maxHeight: 350,
17 emptyText: 'Keine Orte gefunden.', 17 emptyText: 'Keine Orte gefunden.',
18 // minHeight and deferEmptyText are needed to be able to show the 18 // minHeight and deferEmptyText are needed to be able to show the
19 // emptyText message. 19 // emptyText message.
45 action: 'delete' 45 action: 'delete'
46 }] 46 }]
47 }]; 47 }];
48 this.columns = [{ 48 this.columns = [{
49 header: 'Typ', 49 header: 'Typ',
50 dataIndex: 'ortsTyp', 50 dataIndex: 'ortszuordnungTyp',
51 width: 50, 51 width: 50,
52 editor: { 52 editor: {
53 allowBlank: false 53 allowBlank: false
54 } 54 }
55 }, { 55 }, {
56 header: 'Staat', 56 header: 'Staat',
57 dataIndex: 'ort', 57 dataIndex: 'ortId',
58 width: 70, 58 width: 70,
59 renderer: function(value) { 59 renderer: function(value) {
60 var store = Ext.data.StoreManager.get('orte'); 60 var store = Ext.data.StoreManager.get('orte');
61 var staaten = Ext.data.StoreManager.get('staaten'); 61 var staaten = Ext.data.StoreManager.get('staaten');
62 var record = 62 var record =
63 staaten.getById(store.getById(value).get('staatId')); 63 staaten.getById(store.getById(value).get('staatId'));
64 return record.get('staatIso'); 64 return record.get('staatIso');
65 } 65 }
66 }, { 66 }, {
67 header: 'Gemeineschlüssel', 67 header: 'Gemeindeschlüssel',
68 dataIndex: 'ort', 68 dataIndex: 'ortId',
69 width: 120, 69 width: 120,
70 renderer: function(value) { 70 renderer: function(value) {
71 var store = Ext.data.StoreManager.get('orte'); 71 var store = Ext.data.StoreManager.get('orte');
72 var record = store.getById(value); 72 var record = store.getById(value);
73 return record.get('gemId'); 73 return record.get('gemId');
74 } 74 }
75 }, { 75 }, {
76 header: 'Gemeindename', 76 header: 'Gemeindename',
77 dataIndex: 'ort', 77 dataIndex: 'ortId',
78 flex: 1, 78 flex: 1,
79 renderer: function(value) { 79 renderer: function(value) {
80 var store = Ext.data.StoreManager.get('orte'); 80 var store = Ext.data.StoreManager.get('orte');
81 var gemeinden = 81 var gemeinden =
82 Ext.data.StoreManager.get('verwaltungseinheiten'); 82 Ext.data.StoreManager.get('verwaltungseinheiten');
84 var gemid = record.get('gemId'); 84 var gemid = record.get('gemId');
85 var record2 = gemeinden.getById(gemid); 85 var record2 = gemeinden.getById(gemid);
86 return record2.get('bezeichnung'); 86 return record2.get('bezeichnung');
87 } 87 }
88 }, { 88 }, {
89 header: 'Messpunkt', 89 header: 'Ortszusatztext',
90 dataIndex: 'ort', 90 dataIndex: 'ortszusatztext'
91 renderer: function(value) {
92 var store = Ext.getStore('orte');
93 var record = store.getById(value);
94 return record.get('bezeichnung');
95 }
96 }]; 91 }];
97 this.listeners = { 92 this.listeners = {
98 select: { 93 select: {
99 fn: this.activateRemoveButton, 94 fn: this.activateRemoveButton,
100 scope: this 95 scope: this

http://lada.wald.intevation.org