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

fix mediadescription in probe form
author Michael Stanko <mstanko@bfs.de>
date Wed, 11 Jan 2017 16:32:51 +0100
parents 835042fa1a1d
children bfdc00c24baf
comparison
equal deleted inserted replaced
1275:1df7a0899ebe 1276:8f37f8832c4a
536 } 536 }
537 else { 537 else {
538 laborMstId = ''; 538 laborMstId = '';
539 } 539 }
540 var id = this.down('messstellelabor').store.count() + 1; 540 var id = this.down('messstellelabor').store.count() + 1;
541 if ( messRecord.get('mstId') === messRecord.get('laborMstId') ) { 541 if ( messRecord.get('mstId') === messRecord.get('laborMstId') ) {
542 displayCombi = mstId.get('messStelle'); 542 displayCombi = mstId.get('messStelle');
543 } else { 543 } else {
544 displayCombi = mstId.get('messStelle') + '/' + laborMstId 544 displayCombi = mstId.get('messStelle') + '/' + laborMstId
545 } 545
546 var newStore = Ext.create('Ext.data.Store', { 546 }
547 model: 'Lada.model.MessstelleLabor', 547 var newStore = Ext.create('Ext.data.Store', {
548 data: [{ 548 model: 'Lada.model.MessstelleLabor',
549 id: id, 549 data: [{
550 laborMst: messRecord.get('laborMstId'), 550 id: id,
551 messStelle: messRecord.get('mstId'), 551 laborMst: messRecord.get('laborMstId'),
552 displayCombi: displayCombi 552 messStelle: messRecord.get('mstId'),
553 }] 553 displayCombi: displayCombi
554 }); 554 }]
555 });
555 this.down('messstellelabor').down('combobox').store = newStore; 556 this.down('messstellelabor').down('combobox').store = newStore;
556 this.down('messstellelabor').setValue(id); 557 this.down('messstellelabor').setValue(id);
557 } 558 }
558 else { 559 else {
559 var mstLaborStore = Ext.data.StoreManager.get('messstellelabor'); 560 var mstLaborStore = Ext.data.StoreManager.get('messstellelabor');
576 } 577 }
577 }, 578 },
578 579
579 setMediaSN: function(ndx, media, beschreibung) { 580 setMediaSN: function(ndx, media, beschreibung) {
580 var mediabeschreibung = this.getForm().findField('media'); 581 var mediabeschreibung = this.getForm().findField('media');
581
582 if (ndx >= 12) { 582 if (ndx >= 12) {
583 mediabeschreibung.setValue(beschreibung); 583 mediabeschreibung.setValue(beschreibung);
584 return; 584 return;
585 } 585 }
586 var me = this; 586 var me = this;
587 var current = this.down('deskriptor[layer=' + ndx + ']'); 587 var current = this.down('deskriptor[layer=' + ndx + ']');
588 var cbox = current.down('combobox'); 588 var cbox = current.down('combobox');
604 cbox.store.load(function(records, op, success) { 604 cbox.store.load(function(records, op, success) {
605 if (!success) { 605 if (!success) {
606 return; 606 return;
607 } 607 }
608 cbox.select(cbox.store.findRecord('sn', parseInt(media[ndx + 1], 10))); 608 cbox.select(cbox.store.findRecord('sn', parseInt(media[ndx + 1], 10)));
609 var mediatext = cbox.store.findRecord('sn', parseInt(media[ndx + 1], 10)); 609 var mediatext = cbox.store.findRecord('sn', parseInt(media[ndx + 1], 10));
610 if (mediatext !== null) { 610 if (mediatext !== null) {
611 if ( (ndx <= 3) && (media[1] === '01') && (mediatext.data.beschreibung !== "leer") ) { 611 if ( (ndx <= 3) && (media[1] === '01') && (mediatext.data.beschreibung !== "leer") ) {
612 beschreibung = mediatext.data.beschreibung; 612 beschreibung = mediatext.data.beschreibung;
613 } else if ( (media[1] !== '01') && (mediatext.data.beschreibung !== "leer") && (ndx <= 1) ) { 613 } else if ( (media[1] !== '01') && (mediatext.data.beschreibung !== "leer") && (ndx <= 1) ) {
614 beschreibung = mediatext.data.beschreibung; 614 beschreibung = mediatext.data.beschreibung;
615 } 615 }
616 } 616 }
617 me.setMediaSN(++ndx, media, beschreibung); 617 me.setMediaSN(++ndx, media, beschreibung);
618 }); 618 });
619 }, 619 },
620 620
621 setMessages: function(errors, warnings) { 621 setMessages: function(errors, warnings) {

http://lada.wald.intevation.org