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

Redesign in Messgrogrammform
author Evi Huber <ehuber@bfs.de>
date Fri, 13 May 2016 14:24:07 +0200
parents 414f7c9908d6
children 92c0fa2f29b0
comparison
equal deleted inserted replaced
1107:9bcd17f7a0ae 1108:7baaf2cd3f57
169 maxLength: 20, 169 maxLength: 20,
170 editable: true 170 editable: true
171 }, { 171 }, {
172 xtype: 'betriebsart', 172 xtype: 'betriebsart',
173 name: 'baId', 173 name: 'baId',
174 margin: '0, 5, 5, 5',
174 fieldLabel: i18n.getMsg('baId'), 175 fieldLabel: i18n.getMsg('baId'),
175 anchor: '100%', 176 //anchor: '100%',
176 labelWidth: 105 177 width: '35%',
178 labelWidth: 80
177 }, { 179 }, {
178 xtype: 'probenart', 180 xtype: 'probenart',
179 editable: false, 181 editable: false,
180 name: 'probenartId', 182 name: 'probenartId',
181 fieldLabel: i18n.getMsg('probenartId'), 183 fieldLabel: i18n.getMsg('probenartId'),
182 margin: '0, 15, 5, 5', 184 margin: '0, 5, 5, 5',
183 width: '20%', 185 width: '20%',
184 labelWidth: 65, 186 labelWidth: 70,
185 allowBlank: false 187 allowBlank: false
186 }] 188 }]
187 }] 189 }]
188 }, { 190 }, {
189 // Zeit 191 // Zeit
220 }, { 222 }, {
221 xtype: 'numberfield', 223 xtype: 'numberfield',
222 fieldLabel: i18n.getMsg('teilintervallBis'), 224 fieldLabel: i18n.getMsg('teilintervallBis'),
223 margin: '0, 15, 5, 5', 225 margin: '0, 15, 5, 5',
224 labelWidth: 18, 226 labelWidth: 18,
225 width: '12%', 227 width: '15%',
226 name: 'teilintervallBis', 228 name: 'teilintervallBis',
227 period: 'end' 229 period: 'end'
228 }, { 230 }, {
229 xtype: 'numberfield', 231 xtype: 'numberfield',
230 margin: '0, 10, 5, 5', 232 margin: '0, 10, 5, 5',
231 fieldLabel: i18n.getMsg('offset'), 233 fieldLabel: i18n.getMsg('offset'),
232 labelWidth: 45, 234 labelWidth: 45,
233 width: '18%', 235 width: '17%',
234 name: 'intervallOffset' 236 name: 'intervallOffset'
235 }] 237 }]
236 }, { 238 }, {
237 xtype: 'probenintervallslider', 239 xtype: 'probenintervallslider',
238 // fieldLabel: i18n.getMsg('intervall'), 240 // fieldLabel: i18n.getMsg('intervall'),
461 i.setMaxValue(max-1); 463 i.setMaxValue(max-1);
462 }, 464 },
463 465
464 setRecord: function(messRecord) { 466 setRecord: function(messRecord) {
465 this.clearMessages(); 467 this.clearMessages();
466
467 this.getForm().loadRecord(messRecord); 468 this.getForm().loadRecord(messRecord);
468 //Set the intervall numberfields and the slider. 469 //Set the intervall numberfields and the slider.
469 this.down('probenintervallslider').setValue([ 470 this.down('probenintervallslider').setValue([
470 messRecord.get('teilintervallVon'), 471 messRecord.get('teilintervallVon'),
471 messRecord.get('teilintervallBis') 472 messRecord.get('teilintervallBis')
491 } 492 }
492 else { 493 else {
493 laborMstId = ''; 494 laborMstId = '';
494 } 495 }
495 var id = this.down('messstellelabor').store.count() + 1; 496 var id = this.down('messstellelabor').store.count() + 1;
496 var newStore = Ext.create('Ext.data.Store', { 497 if ( messRecord.get('mstId') === messRecord.get('laborMstId') ) {
497 model: 'Lada.model.MessstelleLabor', 498 displayCombi = mstId.get('messStelle');
498 data: [{ 499 } else {
499 id: id, 500 displayCombi = mstId.get('messStelle') + '/' + laborMstId
500 laborMst: messRecord.get('laborMstId'), 501 }
501 messStelle: messRecord.get('mstId'), 502 var newStore = Ext.create('Ext.data.Store', {
502 displayCombi: mstId.get('messStelle') + 503 model: 'Lada.model.MessstelleLabor',
503 '/' + laborMstId 504 data: [{
504 }] 505 id: id,
505 }); 506 laborMst: messRecord.get('laborMstId'),
507 messStelle: messRecord.get('mstId'),
508 displayCombi: displayCombi
509 }]
510 });
506 this.down('messstellelabor').down('combobox').store = newStore; 511 this.down('messstellelabor').down('combobox').store = newStore;
507 this.down('messstellelabor').setValue(id); 512 this.down('messstellelabor').setValue(id);
508 } 513 }
509 else { 514 else {
510 var mstLaborStore = Ext.data.StoreManager.get('messstellelabor'); 515 var mstLaborStore = Ext.data.StoreManager.get('messstellelabor');
521 setMediaDesk: function(record) { 526 setMediaDesk: function(record) {
522 var media = record.get('mediaDesk').split(' '); 527 var media = record.get('mediaDesk').split(' ');
523 this.setMediaSN(0, media); 528 this.setMediaSN(0, media);
524 }, 529 },
525 530
526 setMediaSN: function(ndx, media) { 531 setMediaSN: function(ndx, media, beschreibung) {
532 var mediabeschreibung = this.getForm().findField('media');
533
527 if (ndx >= 12) { 534 if (ndx >= 12) {
535 mediabeschreibung.setValue(beschreibung);
528 return; 536 return;
529 } 537 }
530 var me = this; 538 var me = this;
531 var current = this.down('deskriptor[layer=' + ndx + ']'); 539 var current = this.down('deskriptor[layer=' + ndx + ']');
532 var cbox = current.down('combobox'); 540 var cbox = current.down('combobox');
548 cbox.store.load(function(records, op, success) { 556 cbox.store.load(function(records, op, success) {
549 if (!success) { 557 if (!success) {
550 return; 558 return;
551 } 559 }
552 cbox.select(cbox.store.findRecord('sn', parseInt(media[ndx + 1], 10))); 560 cbox.select(cbox.store.findRecord('sn', parseInt(media[ndx + 1], 10)));
553 me.setMediaSN(++ndx, media); 561 var mediatext = cbox.store.findRecord('sn', parseInt(media[ndx + 1], 10));
562 if (mediatext !== null) {
563 if ( (ndx <= 3) && (media[1] === '01') && (mediatext.data.beschreibung !== "leer") ) {
564 beschreibung = mediatext.data.beschreibung;
565 } else if ( (media[1] !== '01') && (mediatext.data.beschreibung !== "leer") && (ndx <= 1) ) {
566 beschreibung = mediatext.data.beschreibung;
567 }
568 }
569 me.setMediaSN(++ndx, media, beschreibung);
554 }); 570 });
555 }, 571 },
556 572
557 setMessages: function(errors, warnings) { 573 setMessages: function(errors, warnings) {
558 var key; 574 var key;

http://lada.wald.intevation.org