comparison app/controller/form/Messprogramm.js @ 1108:7baaf2cd3f57

Redesign in Messgrogrammform
author Evi Huber <ehuber@bfs.de>
date Fri, 13 May 2016 14:24:07 +0200
parents 60af12dd4a13
children d57462b81444 c63acd44f8ca
comparison
equal deleted inserted replaced
1107:9bcd17f7a0ae 1108:7baaf2cd3f57
82 */ 82 */
83 setNetzbetreiber: function(combo, records){ 83 setNetzbetreiber: function(combo, records){
84 var netzbetreiber = combo.up().up('form') 84 var netzbetreiber = combo.up().up('form')
85 .down('netzbetreiber').down('combobox'); 85 .down('netzbetreiber').down('combobox');
86 var nbId = records[0].get('netzbetreiberId'); 86 var nbId = records[0].get('netzbetreiberId');
87
88 if (nbId != null) { 87 if (nbId != null) {
89 //select the NB in the NB-Combobox 88 //select the NB in the NB-Combobox
90 netzbetreiber.select(nbId); 89 netzbetreiber.select(nbId);
91 } 90 }
92 }, 91 },
321 320
322 deskriptorSelect: function(field, records) { 321 deskriptorSelect: function(field, records) {
323 var desk = field.up('deskriptor'); 322 var desk = field.up('deskriptor');
324 var media = field.up('messprogrammform').down('textfield[name="mediaDesk"]'); 323 var media = field.up('messprogrammform').down('textfield[name="mediaDesk"]');
325 var current = media.getValue().split(' '); 324 var current = media.getValue().split(' ');
326
327 if (current.length < 12) { 325 if (current.length < 12) {
326 var value;
328 for (var i = 0; i <= 12; i++) { 327 for (var i = 0; i <= 12; i++) {
329 if (i === 0) { 328 if (i === 0) {
330 current.push('D:'); 329 current.push('D:');
331 } 330 }
332 else if (i === desk.layer + 1) { 331 else if (i === desk.layer + 1) {
363 current[4] = '00'; 362 current[4] = '00';
364 desk.up('fieldset').down('deskriptor[layer=3]').clearValue(); 363 desk.up('fieldset').down('deskriptor[layer=3]').clearValue();
365 } 364 }
366 } 365 }
367 media.setValue(current.join(' ').trim()); 366 media.setValue(current.join(' ').trim());
367
368 if (current[0].length == 0) {
369 current.splice(0,1);
370 }
371 var mediatext = field.up('messprogrammform').down('textfield[name="media"]');
372
373 if ( (desk.layer === 0 ) && (records[0].get('sn') === 0) ){
374 mediatext.setValue('');
375 } else {
376 if ( current[1] === '01') {
377 if ( (current[5] !== '00') && (desk.layer === 4 ) ){
378 //mediatext.setValue(records[0].data.beschreibung);
379 } else if ( (current[4] !== '00') && (desk.layer === 3) ) {
380 mediatext.setValue(records[0].data.beschreibung);
381 } else if ( (current[3] !== '00') && (desk.layer === 2) ) {
382 mediatext.setValue(records[0].data.beschreibung);
383 } else if ( (current[2] !== '00') && (desk.layer === 1) ) {
384 mediatext.setValue(records[0].data.beschreibung);
385 } else if ( (current[1] !== '00') && (desk.layer === 0 )) {
386 mediatext.setValue(records[0].data.beschreibung);
387 }
388 }
389
390 if ( current[1] !== '01') {
391 if ((current[2] !== '00') && (desk.layer === 1 )) {
392 mediatext.setValue(records[0].data.beschreibung);
393 } else if ((current[1] !== '00') && (desk.layer === 0 )) {
394 mediatext.setValue(records[0].data.beschreibung);
395 }
396 }
397 }
368 }, 398 },
369 399
370 clearChildDesk: function(field) { 400 clearChildDesk: function(field) {
371 var allS = field.up('fieldset').items.items; 401 var allS = field.up('fieldset').items.items;
372 for (var i = field.layer + 1; i < 12; i++) { 402 for (var i = field.layer + 1; i < 12; i++) {

http://lada.wald.intevation.org