comparison app/view/form/Probe.js @ 1276:8f37f8832c4a

fix mediadescription in probe form
author Michael Stanko <mstanko@bfs.de>
date Wed, 11 Jan 2017 16:32:51 +0100
parents 03826fba90bb
children 197ba385bc31
comparison
equal deleted inserted replaced
1275:1df7a0899ebe 1276:8f37f8832c4a
414 var mediaParts = media.split(' '); 414 var mediaParts = media.split(' ');
415 this.setMediaSN(0, mediaParts); 415 this.setMediaSN(0, mediaParts);
416 } 416 }
417 }, 417 },
418 418
419 setMediaSN: function(ndx, media) { 419 setMediaSN: function(ndx, media, beschreibung) {
420 if (ndx >= 12) { 420 if (ndx >= 12) {
421 mediabeschreibung.setValue(beschreibung);
421 return; 422 return;
422 } 423 }
423 var me = this; 424 var me = this;
424 var current = this.down('deskriptor[layer=' + ndx + ']'); 425 var current = this.down('deskriptor[layer=' + ndx + ']');
425 var cbox = current.down('combobox'); 426 var cbox = current.down('combobox');
441 cbox.store.load(function(records, op, success) { 442 cbox.store.load(function(records, op, success) {
442 if (!success) { 443 if (!success) {
443 return; 444 return;
444 } 445 }
445 cbox.select(cbox.store.findRecord('sn', parseInt(media[ndx + 1], 10))); 446 cbox.select(cbox.store.findRecord('sn', parseInt(media[ndx + 1], 10)));
446 me.setMediaSN(++ndx, media); 447 var mediatext = cbox.store.findRecord('sn', parseInt(media[ndx + 1], 10));
448 if (mediatext !== null) {
449 if ( (ndx <= 3) && (media[1] === '01') && (mediatext.data.beschreibung !== "leer") ) {
450 beschreibung = mediatext.data.beschreibung;
451 } else if ( (media[1] !== '01') && (mediatext.data.beschreibung !== "leer") && (ndx <= 1) ) {
452 beschreibung = mediatext.data.beschreibung;
453 }
454 }
455 me.setMediaSN(++ndx, media, beschreibung);
447 }); 456 });
448 }, 457 },
449 458
450 setMessages: function(errors, warnings) { 459 setMessages: function(errors, warnings) {
451 var key; 460 var key;

http://lada.wald.intevation.org