Mercurial > lada > lada-client
comparison app/view/grid/Orte.js @ 1130:e4952906634d
Implemented insert, edit and delete for stammdaten.ort.
author | Raimund Renkert <raimund.renkert@intevation.de> |
---|---|
date | Wed, 25 May 2016 14:04:51 +0200 |
parents | 5e9a674d7bb4 |
children | 6408811c5c41 450368f67858 |
comparison
equal
deleted
inserted
replaced
1126:f1d234a7adc7 | 1130:e4952906634d |
---|---|
54 return 'edit'; | 54 return 'edit'; |
55 } | 55 } |
56 return 'noedit'; | 56 return 'noedit'; |
57 } | 57 } |
58 }, { | 58 }, { |
59 header: i18n.getMsg('netzbetreiber'), | |
60 renderer: function(value) { | |
61 var r = ''; | |
62 if (!value || value === '') { | |
63 r = 'Error'; | |
64 } | |
65 var store = Ext.data.StoreManager.get('netzbetreiber'); | |
66 var record = store.getById(value); | |
67 if (record) { | |
68 r = record.get('netzbetreiber'); | |
69 } | |
70 return r; | |
71 }, | |
72 editor: { | |
73 xtype: 'combobox', | |
74 store: Ext.data.StoreManager.get('netzbetreiberFiltered'), | |
75 displayField: 'netzbetreiber', | |
76 valueField: 'id', | |
77 allowBlank: false | |
78 }, | |
79 dataIndex: 'netzbetreiberId' | |
80 }, { | |
59 header: i18n.getMsg('orte.ortId'), | 81 header: i18n.getMsg('orte.ortId'), |
82 editor: { | |
83 xtype: 'textfield' | |
84 }, | |
60 dataIndex: 'ortId' | 85 dataIndex: 'ortId' |
61 }, { | 86 }, { |
62 header: i18n.getMsg('orte.nutsCode'), | 87 header: i18n.getMsg('orte.nutsCode'), |
88 editor: { | |
89 xtype: 'textfield' | |
90 }, | |
63 dataIndex: 'nutsCode' | 91 dataIndex: 'nutsCode' |
64 }, { | 92 }, { |
65 header: i18n.getMsg('orte.anlageId'), | 93 header: i18n.getMsg('orte.anlageId'), |
94 editor: { | |
95 xtype: 'numberfield' | |
96 }, | |
66 dataIndex: 'anlageId' | 97 dataIndex: 'anlageId' |
67 }, { | 98 }, { |
68 header: i18n.getMsg('orte.gemId'), | 99 header: i18n.getMsg('orte.gemId'), |
69 dataIndex: 'gemId', | 100 dataIndex: 'gemId', |
70 width: 120, | 101 width: 120, |
71 renderer: function(value) { | 102 renderer: function(value) { |
103 if (!value) { | |
104 return ''; | |
105 } | |
72 var store = Ext.data.StoreManager.get('verwaltungseinheiten'); | 106 var store = Ext.data.StoreManager.get('verwaltungseinheiten'); |
73 var record = store.getById(value); | 107 var record = store.getById(value); |
74 return record.get('bezeichnung'); | 108 return record.get('bezeichnung'); |
109 }, | |
110 editor: { | |
111 xtype: 'combobox', | |
112 store: Ext.data.StoreManager.get('verwaltungseinheiten'), | |
113 displayField: 'bezeichnung', | |
114 valueField: 'id', | |
115 allowBlank: false | |
75 } | 116 } |
76 }, { | 117 }, { |
77 header: i18n.getMsg('orte.staatId'), | 118 header: i18n.getMsg('orte.staatId'), |
78 dataIndex: 'staatId', | 119 dataIndex: 'staatId', |
79 width: 70, | 120 width: 70, |
80 renderer: function(value) { | 121 renderer: function(value) { |
122 if (!value) { | |
123 return ''; | |
124 } | |
81 var staaten = Ext.data.StoreManager.get('staaten'); | 125 var staaten = Ext.data.StoreManager.get('staaten'); |
82 var record = staaten.getById(value); | 126 var record = staaten.getById(value); |
83 return record.get('staatIso'); | 127 return record.get('staatIso'); |
128 }, | |
129 editor: { | |
130 xtype: 'combobox', | |
131 store: Ext.data.StoreManager.get('staaten'), | |
132 displayField: 'staatIso', | |
133 valueField: 'id', | |
134 allowBlank: false | |
84 } | 135 } |
85 }, { | 136 }, { |
86 header: i18n.getMsg('orte.kdaId'), | 137 header: i18n.getMsg('orte.kdaId'), |
138 editor: { | |
139 xtype: 'numberfield', | |
140 allowBlank: false | |
141 }, | |
87 dataIndex: 'kdaId' | 142 dataIndex: 'kdaId' |
88 }, { | 143 }, { |
89 header: i18n.getMsg('orte.ozId'), | 144 header: i18n.getMsg('orte.ozId'), |
90 dataIndex: 'ozId' | 145 dataIndex: 'ozId' |
91 }, { | 146 }, { |
92 header: i18n.getMsg('orte.ortTyp'), | 147 header: i18n.getMsg('orte.ortTyp'), |
93 dataIndex: 'ortTyp' | 148 dataIndex: 'ortTyp' |
94 }, { | 149 }, { |
95 header: i18n.getMsg('orte.mpArt'), | 150 header: i18n.getMsg('orte.mpArt'), |
151 editor: { | |
152 xtype: 'textfield' | |
153 }, | |
96 dataIndex: 'mpArt' | 154 dataIndex: 'mpArt' |
97 }, { | 155 }, { |
98 header: i18n.getMsg('orte.zone'), | 156 header: i18n.getMsg('orte.zone'), |
157 editor: { | |
158 xtype: 'textfield' | |
159 }, | |
99 dataIndex: 'zone' | 160 dataIndex: 'zone' |
100 }, { | 161 }, { |
101 header: i18n.getMsg('orte.sektor'), | 162 header: i18n.getMsg('orte.sektor'), |
163 editor: { | |
164 xtype: 'textfield' | |
165 }, | |
102 dataIndex: 'sektor' | 166 dataIndex: 'sektor' |
103 }, { | 167 }, { |
104 header: i18n.getMsg('orte.zustaendigkeit'), | 168 header: i18n.getMsg('orte.zustaendigkeit'), |
169 editor: { | |
170 xtype: 'textfield' | |
171 }, | |
105 dataIndex: 'zustaendigkeit' | 172 dataIndex: 'zustaendigkeit' |
106 }, { | 173 }, { |
107 header: i18n.getMsg('orte.berichtstext'), | 174 header: i18n.getMsg('orte.berichtstext'), |
175 editor: { | |
176 xtype: 'textfield' | |
177 }, | |
108 dataIndex: 'berichtstext' | 178 dataIndex: 'berichtstext' |
109 }, { | 179 }, { |
110 header: i18n.getMsg('orte.kurztext'), | 180 header: i18n.getMsg('orte.kurztext'), |
181 editor: { | |
182 xtype: 'textfield' | |
183 }, | |
111 dataIndex: 'kurztext' | 184 dataIndex: 'kurztext' |
112 }, { | 185 }, { |
113 header: i18n.getMsg('orte.langtext'), | 186 header: i18n.getMsg('orte.langtext'), |
187 editor: { | |
188 xtype: 'textfield' | |
189 }, | |
114 dataIndex: 'langtext' | 190 dataIndex: 'langtext' |
115 }, { | 191 }, { |
116 header: i18n.getMsg('orte.beschreibung'), | |
117 dataIndex: 'beschreibung' | |
118 }, { | |
119 header: i18n.getMsg('orte.unscharf'), | 192 header: i18n.getMsg('orte.unscharf'), |
193 editor: { | |
194 xtype: 'textfield' | |
195 }, | |
120 dataIndex: 'unscharf' | 196 dataIndex: 'unscharf' |
121 }, { | 197 }, { |
122 header: i18n.getMsg('orte.hoeheLand'), | 198 header: i18n.getMsg('orte.hoeheLand'), |
199 editor: { | |
200 xtype: 'numberfield' | |
201 }, | |
123 dataIndex: 'hoeheLand' | 202 dataIndex: 'hoeheLand' |
124 }, { | 203 }, { |
125 header: i18n.getMsg('orte.koordXExtern'), | 204 header: i18n.getMsg('orte.koordXExtern'), |
205 editor: { | |
206 xtype: 'textfield' | |
207 }, | |
126 dataIndex: 'koordXExtern' | 208 dataIndex: 'koordXExtern' |
127 }, { | 209 }, { |
128 header: i18n.getMsg('orte.koordYExtern'), | 210 header: i18n.getMsg('orte.koordYExtern'), |
211 editor: { | |
212 xtype: 'textfield' | |
213 }, | |
129 dataIndex: 'koordYExtern' | 214 dataIndex: 'koordYExtern' |
130 }, { | 215 }, { |
131 header: i18n.getMsg('orte.longitude'), | 216 header: i18n.getMsg('orte.longitude'), |
217 editor: { | |
218 xtype: 'numberfield' | |
219 }, | |
132 dataIndex: 'longitude' | 220 dataIndex: 'longitude' |
133 }, { | 221 }, { |
134 header: i18n.getMsg('orte.latitude'), | 222 header: i18n.getMsg('orte.latitude'), |
223 editor: { | |
224 xtype: 'numberfield' | |
225 }, | |
135 dataIndex: 'latitude' | 226 dataIndex: 'latitude' |
136 }, { | 227 }, { |
137 header: i18n.getMsg('orte.letzteAenderung'), | 228 header: i18n.getMsg('orte.letzteAenderung'), |
138 dataIndex: 'letzteAenderung' | 229 dataIndex: 'letzteAenderung' |
139 }]; | 230 }]; |
161 store: store, | 252 store: store, |
162 displayInfo: true | 253 displayInfo: true |
163 }]); | 254 }]); |
164 } | 255 } |
165 } | 256 } |
257 | |
258 if (Ext.Array.contains(Lada.funktionen, 4)) { | |
259 var panel = this.up('ortpanel'); | |
260 panel.down('button[action=add]').enable(); | |
261 panel.down('button[action=addMap]').enable(); | |
262 } | |
166 }, | 263 }, |
167 | 264 |
168 selectOrt: function(map, feature) { | 265 selectOrt: function(map, feature) { |
169 var id = feature[0].data.id; | 266 var id = feature[0].data.id; |
170 var record = this.store.getById(id); | 267 var record = this.store.getById(id); |