Mercurial > lada > lada-client
comparison app/view/form/Probe.js @ 924:9265637fe6c0
changed layout of Probe form
author | Michael Stanko <mstanko@bfs.de> |
---|---|
date | Wed, 26 Aug 2015 15:29:29 +0200 |
parents | a1d72228af00 |
children | c75f13578315 |
comparison
equal
deleted
inserted
replaced
923:7cbbe0485d0d | 924:9265637fe6c0 |
---|---|
4 * This file is Free Software under the GNU GPL (v>=3) | 4 * This file is Free Software under the GNU GPL (v>=3) |
5 * and comes with ABSOLUTELY NO WARRANTY! Check out | 5 * and comes with ABSOLUTELY NO WARRANTY! Check out |
6 * the documentation coming with IMIS-Labordaten-Application for details. | 6 * the documentation coming with IMIS-Labordaten-Application for details. |
7 */ | 7 */ |
8 | 8 |
9 /** | 9 /* |
10 * Form to edit a Probe | 10 * Formular to edit a Probe |
11 */ | 11 */ |
12 Ext.define('Lada.view.form.Probe', { | 12 Ext.define('Lada.view.form.Probe', { |
13 extend: 'Ext.form.Panel', | 13 extend: 'Ext.form.Panel', |
14 alias: 'widget.probeform', | 14 alias: 'widget.probeform', |
15 requires: [ | 15 requires: [ |
16 'Lada.view.widget.Datenbasis', | 16 'Lada.view.widget.Datenbasis', |
17 'Lada.view.widget.base.CheckBox', | |
17 'Lada.view.widget.Messstelle', | 18 'Lada.view.widget.Messstelle', |
18 'Lada.view.widget.Netzbetreiber', | 19 'Lada.view.widget.Netzbetreiber', |
19 'Lada.view.widget.Betriebsart', | 20 'Lada.view.widget.Betriebsart', |
20 'Lada.view.widget.Testdatensatz', | |
21 'Lada.view.widget.Probenart', | 21 'Lada.view.widget.Probenart', |
22 'Lada.view.widget.Umwelt', | 22 'Lada.view.widget.Umwelt', |
23 'Lada.view.widget.Deskriptor', | 23 'Lada.view.widget.Deskriptor', |
24 'Lada.view.widget.base.TextField', | 24 'Lada.view.widget.base.TextField', |
25 'Lada.view.widget.base.Datetime', | 25 'Lada.view.widget.base.Datetime', |
67 action: 'discard', | 67 action: 'discard', |
68 disabled: true | 68 disabled: true |
69 }] | 69 }] |
70 }], | 70 }], |
71 items: [{ | 71 items: [{ |
72 layout: 'hbox', | 72 layout: 'vbox', |
73 border: 0, | 73 border: 0, |
74 items: [{ | 74 items: [{ |
75 border: 0, | 75 layout: { |
76 width: '50%', | 76 type: 'hbox', |
77 minWidth: 290, | 77 align: 'stretch' |
78 layout: { | 78 }, |
79 type: 'vbox', | 79 border: 0, |
80 align: 'stretch' | 80 width: '100%', |
81 }, | |
82 margin: '0, 10, 0, 0', | |
83 items: [{ | |
84 xtype: 'messstelle', | |
85 name: 'mstId', | |
86 fieldLabel: 'Messstelle', | |
87 labelWidth: 135, | |
88 allowBlank: false, | |
89 editable: true | |
90 }, { | |
91 xtype: 'tfield', | |
92 name: 'hauptprobenNr', | |
93 maxLength: 20, | |
94 fieldLabel: 'Hauptprobennr.', | |
95 labelWidth: 135 | |
96 }] | |
97 }, { | |
98 border: 0, | |
99 width: '50%', | |
100 minWidth: 300, | |
101 margin: '0, 1, 0, 0', | |
102 items: [{ | |
103 xtype: 'fset', | |
104 title: 'Erweiterte Angaben', | |
105 name: 'erwAngaben', | |
106 collapsible: true, | |
107 collapsed: true, | |
108 items: [{ | 81 items: [{ |
109 xtype: 'datenbasis', | 82 xtype: 'messstelle', |
110 editable: false, | 83 name: 'mstId', |
111 name: 'datenbasisId', | 84 fieldLabel: 'Messstelle', |
112 fieldLabel: 'Datenbasis', | 85 margin: '0, 5, 5, 5', |
113 anchor: '100%', | 86 width: '35%', |
114 labelWidth: 105 | 87 labelWidth: 90, |
115 }, { | 88 allowBlank: false, |
116 xtype: 'betriebsart', | 89 editable: true |
117 name: 'baId', | |
118 fieldLabel: 'Betriebsart', | |
119 anchor: '100%', | |
120 labelWidth: 105 | |
121 }, { | |
122 xtype: 'testdatensatz', | |
123 name: 'test', | |
124 fieldLabel: 'Testdatensatz', | |
125 anchor: '100%', | |
126 labelWidth: 105, | |
127 allowBlank: false | |
128 }, { | |
129 xtype: 'probenart', | |
130 editable: false, | |
131 name: 'probenartId', | |
132 fieldLabel: 'Probenart', | |
133 anchor: '100%', | |
134 labelWidth: 105, | |
135 allowBlank: false | |
136 }, { | |
137 xtype: 'numberfield', | |
138 allowDecimals: false, | |
139 name: 'probeNehmerId', | |
140 fieldLabel: 'Probennehmer', | |
141 minValue: 0, | |
142 anchor: '100%', | |
143 labelWidth: 105 | |
144 }, { | 90 }, { |
145 xtype: 'netzbetreiber', | 91 xtype: 'netzbetreiber', |
146 name: 'netzbetreiberId', | 92 name: 'netzbetreiberId', |
147 editable: false, | 93 editable: false, |
148 readOnly: true, | 94 readOnly: true, |
149 fieldLabel: 'Netzbetreiber', | 95 fieldLabel: 'Netzbetreiber', |
96 margin: '0, 5, 5, 5', | |
97 width: '35%', | |
98 labelWidth: 80, | |
99 allowBlank: false | |
100 }, { | |
101 xtype: 'datenbasis', | |
102 editable: false, | |
103 name: 'datenbasisId', | |
104 fieldLabel: 'Datenbasis', | |
105 margin: '0, 5, 5, 5', | |
106 width: '20%', | |
107 labelWidth: 65 | |
108 }, { | |
109 xtype: 'chkbox', | |
110 name: 'test', | |
111 fieldLabel: 'Test', | |
112 margin: '0, 5, 5, 5', | |
113 width: '10%', | |
150 anchor: '100%', | 114 anchor: '100%', |
151 labelWidth: 105, | 115 labelWidth: 30 |
116 }] | |
117 }, { | |
118 layout: { | |
119 type: 'hbox', | |
120 align: 'stretch' | |
121 }, | |
122 border: 0, | |
123 width: '100%', | |
124 items: [{ | |
125 xtype: 'tfield', | |
126 name: 'hauptprobenNr', | |
127 fieldLabel: 'Hauptprobennr.', | |
128 margin: '0, 5, 5, 5', | |
129 width: '35%', | |
130 labelWidth: 90, | |
131 maxLength: 20, | |
132 allowBlank: true | |
133 }, { | |
134 xtype: 'betriebsart', | |
135 name: 'baId', | |
136 fieldLabel: 'Messregime', | |
137 margin: '0, 5, 5, 5', | |
138 width: '35%', | |
139 labelWidth: 80 | |
140 }, { | |
141 xtype: 'probenart', | |
142 editable: false, | |
143 name: 'probenartId', | |
144 fieldLabel: 'Probenart', | |
145 margin: '0, 15, 5, 5', | |
146 width: '20%', | |
147 labelWidth: 65, | |
152 allowBlank: false | 148 allowBlank: false |
149 }] | |
150 }, { | |
151 layout: { | |
152 type: 'hbox', | |
153 align: 'stretch' | |
154 }, | |
155 border: 0, | |
156 width: '100%', | |
157 items: [{ | |
158 xtype: 'numberfield', | |
159 allowDecimals: false, | |
160 name: 'probeNehmerId', | |
161 fieldLabel: 'Probennehmer', | |
162 margin: '0, 5, 5, 5', | |
163 width: '50%', | |
164 minValue: 0, | |
165 anchor: '100%', | |
166 labelWidth: 90 | |
153 }, { | 167 }, { |
154 xtype: 'tfield', | 168 xtype: 'tfield', |
155 name: 'x11', | 169 name: 'x11', |
156 fieldLabel: 'Datensatzerzeuger', | 170 fieldLabel: 'Datensatzerzeuger', |
171 margin: '0, 5, 5, 5', | |
172 width: '50%', | |
157 anchor: '100%', | 173 anchor: '100%', |
158 labelWidth: 105 | 174 labelWidth: 90 |
159 }] | 175 }] |
160 }] | 176 }] |
161 }] | |
162 }, { | 177 }, { |
163 // Zeit | 178 // Zeit |
164 xtype: 'fieldset', | 179 xtype: 'fieldset', |
165 title: 'Zeit', | 180 title: 'Zeit', |
166 layout: { | 181 layout: { |
167 type: 'hbox', | 182 type: 'vbox', |
168 pack: 'center', | |
169 align: 'stretch' | 183 align: 'stretch' |
170 }, | 184 }, |
171 items: [{ | 185 items: [{ |
172 xtype: 'fset', | 186 xtype: 'fset', |
173 title: 'Probenentnahme', | 187 name: 'sollzeitPeriod', |
174 name: 'entnahmePeriod', | 188 width: '100%', |
175 anchor: '100%', | 189 border: 0, |
176 width: '50%', | 190 margin: 0, |
177 margin: '0, 5, 5, 5', | |
178 layout: { | 191 layout: { |
179 type: 'vbox', | 192 type: 'hbox', |
180 align: 'stretch' | |
181 }, | 193 }, |
182 items: [{ | 194 items: [{ |
183 xtype: 'datetime', | 195 xtype: 'datetime', |
184 fieldLabel: 'Beginn', | 196 fieldLabel: 'Sollzeitraum von', |
185 labelWidth: 90, | 197 labelWidth: 120, |
186 anchor: '100%', | 198 margin: '0, 5, 5, 5', |
187 name: 'probeentnahmeBeginn', | 199 name: 'solldatumBeginn', |
188 format: 'd.m.Y H:i', | 200 format: 'd.m.Y H:i', |
189 period: 'start' | 201 period: 'start' |
190 }, { | 202 }, { |
191 xtype: 'datetime', | 203 xtype: 'datetime', |
192 fieldLabel: 'Ende', | 204 fieldLabel: 'bis', |
193 labelWidth: 90, | 205 labelWidth: 10, |
194 anchor: '100%', | 206 margin: '0, 5, 5, 5', |
195 name: 'probeentnahmeEnde', | 207 name: 'solldatumEnde', |
196 format: 'd.m.Y H:i', | 208 format: 'd.m.Y H:i', |
197 period: 'end' | 209 period: 'end' |
198 }] | 210 }] |
199 }, { | 211 }, { |
200 xtype: 'fset', | 212 xtype: 'fset', |
201 title: 'Sollzeitraum', | 213 name: 'entnahmePeriod', |
202 name: 'sollzeitPeriod', | 214 width: '100%', |
203 anchor: '100%', | 215 border: 0, |
204 width: '50%', | 216 margin: 0, |
205 margin: '0, 5, 5, 5', | |
206 layout: { | 217 layout: { |
207 type: 'vbox', | 218 type: 'hbox', |
208 align: 'stretch' | |
209 }, | 219 }, |
210 items: [{ | 220 items: [{ |
211 xtype: 'datetime', | 221 xtype: 'datetime', |
212 fieldLabel: 'Von', | 222 fieldLabel: 'Probenentnahme von', |
213 labelWidth: 90, | 223 labelWidth: 120, |
214 anchor: '100%', | 224 margin: '0, 5, 5, 5', |
215 name: 'solldatumBeginn', | 225 name: 'probeentnahmeBeginn', |
216 format: 'd.m.Y H:i', | 226 format: 'd.m.Y H:i', |
217 period: 'start' | 227 period: 'start' |
218 }, { | 228 }, { |
219 xtype: 'datetime', | 229 xtype: 'datetime', |
220 fieldLabel: 'Bis', | 230 fieldLabel: 'bis', |
221 labelWidth: 90, | 231 labelWidth: 10, |
222 anchor: '100%', | 232 margin: '0, 5, 5, 5', |
223 name: 'solldatumEnde', | 233 name: 'probeentnahmeEnde', |
224 format: 'd.m.Y H:i', | 234 format: 'd.m.Y H:i', |
225 period: 'end' | 235 period: 'end' |
226 }] | 236 }] |
227 }] | 237 }] |
228 }, { | 238 }, { |
229 // Medium | 239 // Medium |
230 xtype: 'fieldset', | 240 xtype: 'fieldset', |
231 title: 'Medium', | 241 title: 'Medium', |
242 width: '100%', | |
232 items: [{ | 243 items: [{ |
233 border: 0, | 244 border: 0, |
234 layout: { | 245 layout: { |
235 type: 'vbox', | 246 type: 'vbox', |
236 align: 'stretch' | 247 align: 'stretch' |
237 }, | 248 }, |
238 width: '100%', | 249 width: '100%', |
239 items: [{ | 250 items: [{ |
240 xtype: 'textfield', | |
241 name: 'media', | |
242 labelWidth: 125, | |
243 fieldLabel: 'Medienbezeichnung', | |
244 listeners: { | |
245 dirtychange: { | |
246 fn: this.updateOnChange, | |
247 scope: me | |
248 } | |
249 } | |
250 }, { | |
251 xtype: 'tfield', | |
252 maxLength: 38, | |
253 enforceMaxLength: true, | |
254 name: 'mediaDesk', | |
255 labelWidth: 125, | |
256 fieldLabel: 'Deskriptoren', | |
257 regex: new RegExp('(?:D: ){1}(?:[0-9]{2} ){11}[0-9]{2}'), | |
258 regexText: 'Die Deskriptoren haben das falsche Format.<br />'+ | |
259 'Richtig wäre: D: 99 99 99 99 99 99 99 99 99 99 99 99', | |
260 listeners: { | |
261 dirtychange: { | |
262 fn: this.updateOnChange, | |
263 scope: me | |
264 } | |
265 } | |
266 }, { | |
267 xtype: 'umwelt', | 251 xtype: 'umwelt', |
268 name: 'umwId', | 252 name: 'umwId', |
269 fieldLabel: 'Umweltbereich', | 253 fieldLabel: 'Umweltbereich', |
270 labelWidth: 125, | 254 labelWidth: 125, |
271 allowBlank: false, | 255 allowBlank: false, |
274 dirtychange: { | 258 dirtychange: { |
275 fn: this.updateOnChange, | 259 fn: this.updateOnChange, |
276 scope: me | 260 scope: me |
277 } | 261 } |
278 } | 262 } |
263 }, { | |
264 border: 0, | |
265 layout: { | |
266 type: 'hbox', | |
267 align: 'stretch' | |
268 }, | |
269 width: '100%', | |
270 items: [{ | |
271 xtype: 'tfield', | |
272 maxLength: 38, | |
273 enforceMaxLength: true, | |
274 name: 'mediaDesk', | |
275 width: '60%', | |
276 minWidth: 290, | |
277 labelWidth: 125, | |
278 fieldLabel: 'Deskriptoren', | |
279 regex: new RegExp('(?:D: ){1}(?:[0-9]{2} ){11}[0-9]{2}'), | |
280 regexText: 'Die Deskriptoren haben das falsche Format.<br />'+ | |
281 'Richtig wäre: D: 99 99 99 99 99 99 99 99 99 99 99 99', | |
282 listeners: { | |
283 dirtychange: { | |
284 fn: this.updateOnChange, | |
285 scope: me | |
286 } | |
287 } | |
288 }, { | |
289 xtype: 'textfield', | |
290 name: 'media', | |
291 margin: '0, 10, 5, 10', | |
292 enforceMaxLength: true, | |
293 editable: false, | |
294 readOnly: true, | |
295 listeners: { | |
296 dirtychange: { | |
297 fn: this.updateOnChange, | |
298 scope: me | |
299 } | |
300 } | |
301 }] | |
279 }, { | 302 }, { |
280 xtype: 'fieldset', | 303 xtype: 'fieldset', |
281 title: 'Details Deskriptoren', | 304 title: 'Details Deskriptoren', |
282 collapsible: true, | 305 collapsible: true, |
283 collapsed: true, | 306 collapsed: true, |
374 clearMessages: function() { | 397 clearMessages: function() { |
375 this.down('cbox[name=mstId]').clearWarningOrError(); | 398 this.down('cbox[name=mstId]').clearWarningOrError(); |
376 this.down('tfield[name=hauptprobenNr]').clearWarningOrError(); | 399 this.down('tfield[name=hauptprobenNr]').clearWarningOrError(); |
377 this.down('cbox[name=datenbasisId]').clearWarningOrError(); | 400 this.down('cbox[name=datenbasisId]').clearWarningOrError(); |
378 this.down('cbox[name=baId]').clearWarningOrError(); | 401 this.down('cbox[name=baId]').clearWarningOrError(); |
379 this.down('cbox[name=test]').clearWarningOrError(); | 402 this.down('chkbox[name=test]').clearWarningOrError(); |
380 this.down('cbox[name=probenartId]').clearWarningOrError(); | 403 this.down('cbox[name=probenartId]').clearWarningOrError(); |
381 this.down('cbox[name=netzbetreiberId]').clearWarningOrError(); | 404 this.down('cbox[name=netzbetreiberId]').clearWarningOrError(); |
382 this.down('tfield[name=x11]').clearWarningOrError(); | 405 this.down('tfield[name=x11]').clearWarningOrError(); |
383 this.down('cbox[name=umwId]').clearWarningOrError(); | 406 this.down('cbox[name=umwId]').clearWarningOrError(); |
384 this.down('datetime[name=probeentnahmeBeginn]').clearWarningOrError(); | 407 this.down('datetime[name=probeentnahmeBeginn]').clearWarningOrError(); |
385 this.down('datetime[name=probeentnahmeEnde]').clearWarningOrError(); | 408 this.down('datetime[name=probeentnahmeEnde]').clearWarningOrError(); |
386 this.down('datetime[name=solldatumBeginn]').clearWarningOrError(); | 409 this.down('datetime[name=solldatumBeginn]').clearWarningOrError(); |
387 this.down('datetime[name=solldatumEnde]').clearWarningOrError(); | 410 this.down('datetime[name=solldatumEnde]').clearWarningOrError(); |
388 //this.down('numberfield[name=probeNehmerId]').clearWarningOrError(); | 411 //this.down('numberfield[name=probeNehmerId]').clearWarningOrError(); |
389 this.down('fset[name=erwAngaben]').clearMessages(); | |
390 this.down('fset[name=entnahmePeriod]').clearMessages(); | 412 this.down('fset[name=entnahmePeriod]').clearMessages(); |
391 this.down('fset[name=sollzeitPeriod]').clearMessages(); | 413 this.down('fset[name=sollzeitPeriod]').clearMessages(); |
392 }, | 414 }, |
393 | 415 |
394 setReadOnly: function(value) { | 416 setReadOnly: function(value) { |
395 this.down('cbox[name=mstId]').setReadOnly(value); | 417 this.down('cbox[name=mstId]').setReadOnly(value); |
396 this.down('tfield[name=hauptprobenNr]').setReadOnly(value); | 418 this.down('tfield[name=hauptprobenNr]').setReadOnly(value); |
397 this.down('cbox[name=datenbasisId]').setReadOnly(value); | 419 this.down('cbox[name=datenbasisId]').setReadOnly(value); |
398 this.down('cbox[name=baId]').setReadOnly(value); | 420 this.down('cbox[name=baId]').setReadOnly(value); |
399 this.down('cbox[name=test]').setReadOnly(value); | 421 this.down('chkbox[name=test]').setReadOnly(value); |
400 this.down('cbox[name=probenartId]').setReadOnly(value); | 422 this.down('cbox[name=probenartId]').setReadOnly(value); |
401 //this.down('cbox[name=netzbetreiberId]').setReadOnly(value); | 423 //this.down('cbox[name=netzbetreiberId]').setReadOnly(value); |
402 this.down('tfield[name=x11]').setReadOnly(value); | 424 this.down('tfield[name=x11]').setReadOnly(value); |
403 this.down('textfield[name=media]').setReadOnly(value); | 425 this.down('textfield[name=media]').setReadOnly(value); |
404 this.down('tfield[name=mediaDesk]').setReadOnly(value); | 426 this.down('tfield[name=mediaDesk]').setReadOnly(value); |