Mercurial > lada > lada-client
comparison app/view/form/Probe.js @ 681:f373446325b4
a probe can not be edited when the readonly flag was sent by the server
author | Dustin Demuth <dustin@intevation.de> |
---|---|
date | Tue, 24 Mar 2015 15:33:11 +0100 |
parents | 08e3e7b80a34 |
children | 69cb367c0a63 |
comparison
equal
deleted
inserted
replaced
680:31fc4f94f98f | 681:f373446325b4 |
---|---|
33 border: 0, | 33 border: 0, |
34 | 34 |
35 recordId: null, | 35 recordId: null, |
36 | 36 |
37 trackResetOnLoad: true, | 37 trackResetOnLoad: true, |
38 readonly: false, | |
38 | 39 |
39 initComponent: function() { | 40 initComponent: function() { |
40 | |
41 var me = this; | 41 var me = this; |
42 this.items = [{ | 42 this.items = [{ |
43 xtype: 'fieldset', | 43 xtype: 'fieldset', |
44 title: 'Allgemein', | 44 title: 'Allgemein', |
45 items: [{ | 45 items: [{ |
285 }] | 285 }] |
286 }] | 286 }] |
287 }] | 287 }] |
288 }] | 288 }] |
289 }]; | 289 }]; |
290 | |
291 this.callParent(arguments); | 290 this.callParent(arguments); |
291 | |
292 if (this.readonly){ | |
293 this.setReadOnly(true); | |
294 } | |
292 }, | 295 }, |
293 | 296 |
294 setRecord: function(record) { | 297 setRecord: function(record) { |
295 this.getForm().loadRecord(record); | 298 this.getForm().loadRecord(record); |
296 }, | 299 }, |
342 this.down('cbox[name=umwId]').clearWarningOrError(); | 345 this.down('cbox[name=umwId]').clearWarningOrError(); |
343 this.down('datetime[name=probeentnahmeBeginn]').clearWarningOrError(); | 346 this.down('datetime[name=probeentnahmeBeginn]').clearWarningOrError(); |
344 this.down('datetime[name=probeentnahmeEnde]').clearWarningOrError(); | 347 this.down('datetime[name=probeentnahmeEnde]').clearWarningOrError(); |
345 this.down('datetime[name=solldatumBeginn]').clearWarningOrError(); | 348 this.down('datetime[name=solldatumBeginn]').clearWarningOrError(); |
346 this.down('datetime[name=solldatumEnde]').clearWarningOrError(); | 349 this.down('datetime[name=solldatumEnde]').clearWarningOrError(); |
347 //this.down('cbox[name=probeNehmerId]').setReadOnly(value); | 350 //this.down('numberfield[name=probeNehmerId]').clearWarningOrError(); |
348 }, | 351 }, |
349 | 352 |
350 setReadOnly: function(value) { | 353 setReadOnly: function(value) { |
351 this.down('cbox[name=mstId]').setReadOnly(value); | 354 this.down('cbox[name=mstId]').setReadOnly(value); |
352 this.down('tfield[name=hauptprobenNr]').setReadOnly(value); | 355 this.down('tfield[name=hauptprobenNr]').setReadOnly(value); |
361 this.down('cbox[name=umwId]').setReadOnly(value); | 364 this.down('cbox[name=umwId]').setReadOnly(value); |
362 this.down('datetime[name=probeentnahmeBeginn]').setReadOnly(value); | 365 this.down('datetime[name=probeentnahmeBeginn]').setReadOnly(value); |
363 this.down('datetime[name=probeentnahmeEnde]').setReadOnly(value); | 366 this.down('datetime[name=probeentnahmeEnde]').setReadOnly(value); |
364 this.down('datetime[name=solldatumBeginn]').setReadOnly(value); | 367 this.down('datetime[name=solldatumBeginn]').setReadOnly(value); |
365 this.down('datetime[name=solldatumEnde]').setReadOnly(value); | 368 this.down('datetime[name=solldatumEnde]').setReadOnly(value); |
366 //this.down('cbox[name=probeNehmerId]').setReadOnly(value); | 369 this.down('numberfield[name=probeNehmerId]').setReadOnly(value); |
367 }, | 370 }, |
368 | 371 |
369 buildDescriptors: function() { | 372 buildDescriptors: function() { |
370 var fields = []; | 373 var fields = []; |
374 var ro = false; | |
375 if (this.readonly) { | |
376 ro = true; | |
377 } | |
371 for (var i = 0; i < 12; i++) { | 378 for (var i = 0; i < 12; i++) { |
372 fields[i] = { | 379 fields[i] = { |
373 fieldLabel: 'S' + i, | 380 fieldLabel: 'S' + i, |
374 name: 's' + i, | 381 name: 's' + i, |
375 labelWidth: 25, | 382 labelWidth: 25, |
376 margin: '0, 10, 5, 0' | 383 margin: '0, 10, 5, 0', |
384 readOnly: ro | |
377 }; | 385 }; |
378 } | 386 } |
379 return fields; | 387 return fields; |
380 } | 388 } |
381 }); | 389 }); |