comparison app/view/grid/Ortszuordnung.js @ 1351:036c594de978

Fix checks for not given foreign keys.
author Tom Gottfried <tom@intevation.de>
date Tue, 07 Feb 2017 14:55:34 +0100
parents c05a5534f0d9
children 76ff6d084167
comparison
equal deleted inserted replaced
1350:ba106500af0b 1351:036c594de978
103 flex: 1, 103 flex: 1,
104 renderer: function(value) { 104 renderer: function(value) {
105 var store = Ext.data.StoreManager.get('orte'); 105 var store = Ext.data.StoreManager.get('orte');
106 var staaten = Ext.data.StoreManager.get('staaten'); 106 var staaten = Ext.data.StoreManager.get('staaten');
107 var ortRecord = store.getById(value); 107 var ortRecord = store.getById(value);
108 if (!ortRecord || ortRecord.get('staatId') === '') { 108 if (!ortRecord) {
109 return ''; 109 return '';
110 } 110 }
111 var record = staaten.getById(ortRecord.get('staatId')); 111 var stId = ortRecord.get('staatId');
112 if (stId == undefined || stId == null || stId === '') {
113 return '';
114 }
115 var record = staaten.getById(stId);
112 return record.get('staatIso'); 116 return record.get('staatIso');
113 } 117 }
114 }, { 118 }, {
115 header: i18n.getMsg('orte.gemId'), 119 header: i18n.getMsg('orte.gemId'),
116 dataIndex: 'ortId', 120 dataIndex: 'ortId',
130 renderer: function(value) { 134 renderer: function(value) {
131 var store = Ext.data.StoreManager.get('orte'); 135 var store = Ext.data.StoreManager.get('orte');
132 var gemeinden = 136 var gemeinden =
133 Ext.data.StoreManager.get('verwaltungseinheiten'); 137 Ext.data.StoreManager.get('verwaltungseinheiten');
134 var record = store.getById(value); 138 var record = store.getById(value);
135 if (!record || record.get('gemId') === '') { 139 if (!record) {
136 return ''; 140 return '';
137 } 141 }
138 var gemid = record.get('gemId'); 142 var gemid = record.get('gemId');
143 if (gemid == undefined || gemid == null || gemid === '') {
144 return '';
145 }
139 var record2 = gemeinden.getById(gemid); 146 var record2 = gemeinden.getById(gemid);
140 return record2.get('bezeichnung'); 147 return record2.get('bezeichnung');
141 } 148 }
142 }, { 149 }, {
143 header: i18n.getMsg('orte.anlageId'), 150 header: i18n.getMsg('orte.anlageId'),
144 dataIndex: 'ortId', 151 dataIndex: 'ortId',
145 flex: 3, 152 flex: 3,
146 renderer: function(value) { 153 renderer: function(value) {
147 var store = Ext.data.StoreManager.get('orte'); 154 var store = Ext.data.StoreManager.get('orte');
148 var record = store.getById(value); 155 var record = store.getById(value);
149 if (!record || !record.get('anlageId')) { 156 if (!record) {
157 return '';
158 }
159 var ktaId = record.get('anlageId');
160 if (ktaId == undefined || ktaId == null || ktaId === '') {
150 return ''; 161 return '';
151 } 162 }
152 var ktas = Ext.data.StoreManager.get('ktas'); 163 var ktas = Ext.data.StoreManager.get('ktas');
153 var kta = ktas.getById(record.get('anlageId')); 164 var kta = ktas.getById(record.get('anlageId'));
154 return kta.get('code'); 165 return kta.get('code');

http://lada.wald.intevation.org