comparison app/view/grid/Orte.js @ 1317:46093e6f45d2

Use the new stammdaten to display and edit ort attributes.
author Raimund Renkert <raimund.renkert@intevation.de>
date Fri, 03 Feb 2017 13:17:54 +0100
parents 6075731bc4f1
children 35bbbfbe130c
comparison
equal deleted inserted replaced
1316:f772e70ff723 1317:46093e6f45d2
12 Ext.define('Lada.view.grid.Orte', { 12 Ext.define('Lada.view.grid.Orte', {
13 extend: 'Ext.grid.Panel', 13 extend: 'Ext.grid.Panel',
14 alias: 'widget.ortstammdatengrid', 14 alias: 'widget.ortstammdatengrid',
15 15
16 requires: [ 16 requires: [
17 'Ext.ux.grid.FiltersFeature' 17 'Ext.ux.grid.FiltersFeature',
18 'Lada.view.widget.KoordinatenArt',
19 'Lada.view.widget.Kta',
20 'Lada.view.widget.OrtsZusatz',
21 'Lada.view.widget.OrtTyp'
18 ], 22 ],
19 // minHeight and deferEmptyText are needed to be able to show the 23 // minHeight and deferEmptyText are needed to be able to show the
20 // emptyText message. 24 // emptyText message.
21 minHeight: 110, 25 minHeight: 110,
22 viewConfig: { 26 viewConfig: {
117 }, 121 },
118 dataIndex: 'nutsCode' 122 dataIndex: 'nutsCode'
119 }, { 123 }, {
120 header: i18n.getMsg('orte.anlageId'), 124 header: i18n.getMsg('orte.anlageId'),
121 editor: { 125 editor: {
122 xtype: 'numberfield' 126 xtype: 'kta'
127 },
128 renderer: function(value) {
129 if (value === undefined ||
130 value === null ||
131 value === ''
132 ) {
133 return '';
134 }
135 var store = Ext.data.StoreManager.get('ktas');
136 var record = store.getById(value);
137 return record.get('code');
123 }, 138 },
124 dataIndex: 'anlageId' 139 dataIndex: 'anlageId'
125 }, { 140 }, {
126 header: i18n.getMsg('orte.verwaltungseinheit'), 141 header: i18n.getMsg('orte.verwaltungseinheit'),
127 dataIndex: 'gemId', 142 dataIndex: 'gemId',
167 allowBlank: false 182 allowBlank: false
168 } 183 }
169 }, { 184 }, {
170 header: i18n.getMsg('orte.kdaId'), 185 header: i18n.getMsg('orte.kdaId'),
171 filter: { 186 filter: {
172 type: 'numeric' 187 type: 'string'
173 }, 188 },
174 editor: { 189 editor: {
175 xtype: 'numberfield', 190 xtype: 'koordinatenart',
176 allowBlank: false 191 allowBlank: false
192 },
193 renderer: function(value) {
194 if (value === undefined || value === '') {
195 return '';
196 }
197 var kda = Ext.data.StoreManager.get('koordinatenart');
198 var record = kda.getById(value);
199 return record.get('koordinatenart');
177 }, 200 },
178 dataIndex: 'kdaId' 201 dataIndex: 'kdaId'
179 }, { 202 }, {
180 header: i18n.getMsg('orte.ozId'), 203 header: i18n.getMsg('orte.ozId'),
181 filter: { 204 filter: {
182 type: 'string' 205 type: 'string'
183 }, 206 },
207 editor: {
208 xtype: 'ortszusatz',
209 },
210 renderer: function(value) {
211 if (value === undefined ||
212 value === null ||
213 value === ''
214 ) {
215 return '';
216 }
217 var oz = Ext.data.StoreManager.get('ortszusatz');
218 var record = oz.getById(value);
219 return record.get('ozsId');
220 },
184 dataIndex: 'ozId' 221 dataIndex: 'ozId'
185 }, { 222 }, {
186 header: i18n.getMsg('orte.ortTyp'), 223 header: i18n.getMsg('orte.ortTyp'),
187 filter: { 224 filter: {
188 type: 'numeric' 225 type: 'string'
226 },
227 editor: {
228 xtype: 'orttyp',
229 },
230 renderer: function(value) {
231 if (value === undefined ||
232 value === null ||
233 value === ''
234 ) {
235 return '';
236 }
237 var ot = Ext.data.StoreManager.get('orttyp');
238 var record = ot.getById(value);
239 return record.get('code');
189 }, 240 },
190 dataIndex: 'ortTyp' 241 dataIndex: 'ortTyp'
191 }, { 242 }, {
192 header: i18n.getMsg('orte.mpArt'), 243 header: i18n.getMsg('orte.mpArt'),
193 filter: { 244 filter: {

http://lada.wald.intevation.org