comparison app/view/form/Messprogramm.js @ 784:f0b26df02157

Handle deskriptoren in messprogramm like in probe.
author Raimund Renkert <raimund.renkert@intevation.de>
date Wed, 13 May 2015 10:23:39 +0200
parents 3309db91b8c1
children 442e7bd290dc
comparison
equal deleted inserted replaced
783:afdbe3770b99 784:f0b26df02157
397 this.down('probenintervallslider').on( 397 this.down('probenintervallslider').on(
398 'change', 398 'change',
399 Lada.app.getController('Lada.controller.form.Messprogramm') 399 Lada.app.getController('Lada.controller.form.Messprogramm')
400 .synchronizeFields 400 .synchronizeFields
401 ); 401 );
402 402 },
403
404 setMediaDesk: function(record) {
405 var media = record.get('mediaDesk').split(' ');
406 this.setMediaSN(0, media);
407 },
408
409 setMediaSN: function(ndx, media) {
410 if (ndx >= 12) {
411 return;
412 }
413 var me = this;
414 var current = this.down('deskriptor[layer=' + ndx + ']');
415 var cbox = current.down('combobox');
416 if (ndx === 0) {
417 cbox.store.proxy.extraParams = {
418 'layer': ndx
419 };
420 }
421 else {
422 var parents = current.getParents(current.down('combobox'));
423 if (parents.length === 0) {
424 return;
425 }
426 cbox.store.proxy.extraParams = {
427 'layer': ndx,
428 'parents': parents
429 };
430 }
431 cbox.store.load(function(records, op, success) {
432 if (!success) {
433 return;
434 }
435 cbox.select(cbox.store.findRecord('sn', parseInt(media[ndx + 1], 10)));
436 me.setMediaSN(++ndx, media);
437 });
403 }, 438 },
404 439
405 setMessages: function(errors, warnings) { 440 setMessages: function(errors, warnings) {
406 var key; 441 var key;
407 var element; 442 var element;
461 496
462 buildDescriptors: function() { 497 buildDescriptors: function() {
463 var fields = []; 498 var fields = [];
464 for (var i = 0; i < 12; i++) { 499 for (var i = 0; i < 12; i++) {
465 fields[i] = { 500 fields[i] = {
501 xtype: 'deskriptor',
466 fieldLabel: 'S' + i, 502 fieldLabel: 'S' + i,
467 name: 's' + i,
468 labelWidth: 25, 503 labelWidth: 25,
504 width: 190,
505 layer: i,
469 margin: '0, 10, 5, 0' 506 margin: '0, 10, 5, 0'
470 }; 507 };
471 } 508 }
472 return fields; 509 return fields;
473 } 510 }

http://lada.wald.intevation.org