comparison app/view/form/Probe.js @ 646:d945cfeeebeb

Im Probeform den Custom-Datetimepicker durch den Standard Datepicker ersetzt. So funktioniert die Lokalisierung besser
author Dustin Demuth <dustin@intevation.de>
date Tue, 17 Mar 2015 17:10:54 +0100
parents 19d81c9aa97f
children 67963fcb7739
comparison
equal deleted inserted replaced
645:422e71708a0c 646:d945cfeeebeb
21 'Lada.view.widget.Probenart', 21 'Lada.view.widget.Probenart',
22 'Lada.view.widget.Umwelt', 22 'Lada.view.widget.Umwelt',
23 'Lada.view.widget.base.TextField', 23 'Lada.view.widget.base.TextField',
24 'Lada.view.widget.base.Datetime', 24 'Lada.view.widget.base.Datetime',
25 'Lada.view.widget.base.FieldSet', 25 'Lada.view.widget.base.FieldSet',
26 'Lada.model.Probe' 26 'Lada.view.widget.base.DateField',
27 'Lada.model.Probe',
27 ], 28 ],
28 29
29 model: 'Lada.model.Probe', 30 model: 'Lada.model.Probe',
30 minWidth: 650, 31 minWidth: 650,
31 margin: 5, 32 margin: 5,
34 recordId: null, 35 recordId: null,
35 36
36 trackResetOnLoad: true, 37 trackResetOnLoad: true,
37 38
38 initComponent: function() { 39 initComponent: function() {
40
39 var me = this; 41 var me = this;
40 this.items = [{ 42 this.items = [{
41 xtype: 'fieldset', 43 xtype: 'fieldset',
42 title: 'Allgemein', 44 title: 'Allgemein',
43 items: [{ 45 items: [{
221 }, { 223 }, {
222 // Zeit 224 // Zeit
223 xtype: 'fieldset', 225 xtype: 'fieldset',
224 title: 'Zeit', 226 title: 'Zeit',
225 layout: { 227 layout: {
226 type: 'hbox' 228 type: 'hbox',
229 pack: 'center',
230 align: 'stretch'
227 }, 231 },
228 items: [{ 232 items: [{
233 xtype: 'fieldset',
234 title: 'Probenentnahme',
235 anchor: '100%',
236 width: '50%',
237 margin: '0, 5, 5, 5',
229 layout: { 238 layout: {
230 type: 'vbox', 239 type: 'vbox',
231 align: 'stretch' 240 align: 'stretch'
232 }, 241 },
233 border: 0, 242 items: [{
234 items: [{ 243 xtype: 'datef',
235 xtype: 'datetime', 244 fieldLabel: 'Beginn',
236 fieldLabel: 'Probennahme Beginn', 245 labelWidth: 90,
237 fieldMargin: '0, 10, 5, 0', 246 anchor: '100%',
238 labelWidth: 125,
239 name: 'probeentnahmeBeginn', 247 name: 'probeentnahmeBeginn',
240 listeners: { 248 format: 'd.m.Y H:i',
241 dirtychange: { 249 }, {
242 fn: this.updateOnChange, 250 xtype: 'datef',
243 scope: me 251 fieldLabel: 'Ende',
244 } 252 labelWidth: 90,
245 } 253 anchor: '100%',
246 }, {
247 xtype: 'datetime',
248 fieldLabel: 'Probennahme Ende',
249 fieldMargin: '0, 10, 5, 0',
250 labelWidth: 125,
251 name: 'probeentnahmeEnde', 254 name: 'probeentnahmeEnde',
252 listeners: { 255 format: 'd.m.Y H:i',
253 dirtychange: {
254 fn: this.updateOnChange,
255 scope: me
256 }
257 }
258 }] 256 }]
259 }, { 257 }, {
260 layout: 'vbox', 258 xtype: 'fieldset',
261 border: 0, 259 title: 'Sollzeitraum',
262 items: [{ 260 anchor: '100%',
263 xtype: 'datetime', 261 width: '50%',
264 fieldLabel: 'Sollzeit Von', 262 margin: '0, 5, 5, 5',
265 fieldMargin: '0, 10, 5, 0', 263 layout: {
264 type: 'vbox',
265 align: 'stretch',
266 },
267 items: [{
268 xtype: 'datef',
269 fieldLabel: 'Von',
266 labelWidth: 90, 270 labelWidth: 90,
271 anchor: '100%',
267 name: 'solldatumBeginn', 272 name: 'solldatumBeginn',
268 listeners: { 273 format: 'd.m.Y H:i',
269 dirtychange: { 274 }, {
270 fn: this.updateOnChange, 275 xtype: 'datef',
271 scope: me 276 fieldLabel: 'Bis',
272 }
273 }
274 }, {
275 xtype: 'datetime',
276 fieldLabel: 'Sollzeit Bis',
277 fieldMargin: '0, 10, 5, 0',
278 labelWidth: 90, 277 labelWidth: 90,
278 anchor: '100%',
279 name: 'solldatumEnde', 279 name: 'solldatumEnde',
280 listeners: { 280 format: 'd.m.Y H:i',
281 dirtychange: {
282 fn: this.updateOnChange,
283 scope: me
284 }
285 }
286 }] 281 }]
287 }] 282 }]
288 }] 283 }]
289 }] 284 }]
290 }]; 285 }];
286
291 this.callParent(arguments); 287 this.callParent(arguments);
292 }, 288 },
293 289
294 setRecord: function(record) { 290 setRecord: function(record) {
295 this.getForm().loadRecord(record); 291 this.getForm().loadRecord(record);
338 this.down('cbox[name=test]').clearWarningOrError(); 334 this.down('cbox[name=test]').clearWarningOrError();
339 this.down('cbox[name=probenartId]').clearWarningOrError(); 335 this.down('cbox[name=probenartId]').clearWarningOrError();
340 this.down('cbox[name=netzbetreiberId]').clearWarningOrError(); 336 this.down('cbox[name=netzbetreiberId]').clearWarningOrError();
341 this.down('tfield[name=x11]').clearWarningOrError(); 337 this.down('tfield[name=x11]').clearWarningOrError();
342 this.down('cbox[name=umwId]').clearWarningOrError(); 338 this.down('cbox[name=umwId]').clearWarningOrError();
343 this.down('datetime[name=probeentnahmeBeginn]').clearWarningOrError(); 339 this.down('datef[name=probeentnahmeBeginn]').clearWarningOrError();
344 this.down('datetime[name=probeentnahmeEnde]').clearWarningOrError(); 340 this.down('datef[name=probeentnahmeEnde]').clearWarningOrError();
345 this.down('datetime[name=solldatumBeginn]').clearWarningOrError(); 341 this.down('datef[name=solldatumBeginn]').clearWarningOrError();
346 this.down('datetime[name=solldatumEnde]').clearWarningOrError(); 342 this.down('datef[name=solldatumEnde]').clearWarningOrError();
347 //this.down('cbox[name=probeNehmerId]').setReadOnly(value); 343 //this.down('cbox[name=probeNehmerId]').setReadOnly(value);
348 }, 344 },
349 345
350 setReadOnly: function(value) { 346 setReadOnly: function(value) {
351 this.down('cbox[name=mstId]').setReadOnly(value); 347 this.down('cbox[name=mstId]').setReadOnly(value);
357 this.down('cbox[name=netzbetreiberId]').setReadOnly(value); 353 this.down('cbox[name=netzbetreiberId]').setReadOnly(value);
358 this.down('tfield[name=x11]').setReadOnly(value); 354 this.down('tfield[name=x11]').setReadOnly(value);
359 this.down('textfield[name=media]').setReadOnly(value); 355 this.down('textfield[name=media]').setReadOnly(value);
360 this.down('textfield[name=mediaDesk]').setReadOnly(value); 356 this.down('textfield[name=mediaDesk]').setReadOnly(value);
361 this.down('cbox[name=umwId]').setReadOnly(value); 357 this.down('cbox[name=umwId]').setReadOnly(value);
362 this.down('datetime[name=probeentnahmeBeginn]').setReadOnly(value); 358 this.down('datef[name=probeentnahmeBeginn]').setReadOnly(value);
363 this.down('datetime[name=probeentnahmeEnde]').setReadOnly(value); 359 this.down('datef[name=probeentnahmeEnde]').setReadOnly(value);
364 this.down('datetime[name=solldatumBeginn]').setReadOnly(value); 360 this.down('datef[name=solldatumBeginn]').setReadOnly(value);
365 this.down('datetime[name=solldatumEnde]').setReadOnly(value); 361 this.down('datef[name=solldatumEnde]').setReadOnly(value);
366 //this.down('cbox[name=probeNehmerId]').setReadOnly(value); 362 //this.down('cbox[name=probeNehmerId]').setReadOnly(value);
367 }, 363 },
368 364
369 buildDescriptors: function() { 365 buildDescriptors: function() {
370 var fields = []; 366 var fields = [];

http://lada.wald.intevation.org