Mercurial > lada > lada-client
comparison app/controller/form/Messprogramm.js @ 1090:fc17ae7e560c
merged.
author | Raimund Renkert <raimund.renkert@intevation.de> |
---|---|
date | Mon, 09 May 2016 13:02:25 +0200 |
parents | 60af12dd4a13 |
children | 7baaf2cd3f57 |
comparison
equal
deleted
inserted
replaced
1089:01bcca98ae8f | 1090:fc17ae7e560c |
---|---|
5 * and comes with ABSOLUTELY NO WARRANTY! Check out | 5 * and comes with ABSOLUTELY NO WARRANTY! Check out |
6 * the documentation coming with IMIS-Labordaten-Application for details. | 6 * the documentation coming with IMIS-Labordaten-Application for details. |
7 */ | 7 */ |
8 | 8 |
9 /** | 9 /** |
10 * A Controller for a Probe form | 10 * A Controller for a Messprogramm form |
11 */ | 11 */ |
12 Ext.define('Lada.controller.form.Messprogramm', { | 12 Ext.define('Lada.controller.form.Messprogramm', { |
13 extend: 'Ext.app.Controller', | 13 extend: 'Ext.app.Controller', |
14 | 14 |
15 requires: [ | 15 requires: [ |
321 | 321 |
322 deskriptorSelect: function(field, records) { | 322 deskriptorSelect: function(field, records) { |
323 var desk = field.up('deskriptor'); | 323 var desk = field.up('deskriptor'); |
324 var media = field.up('messprogrammform').down('textfield[name="mediaDesk"]'); | 324 var media = field.up('messprogrammform').down('textfield[name="mediaDesk"]'); |
325 var current = media.getValue().split(' '); | 325 var current = media.getValue().split(' '); |
326 if (current.length < 13) { | 326 |
327 if (current.length < 12) { | |
327 for (var i = 0; i <= 12; i++) { | 328 for (var i = 0; i <= 12; i++) { |
328 if (i === 0) { | 329 if (i === 0) { |
329 current.push('D:'); | 330 current.push('D:'); |
330 } | 331 } |
331 else if (i === desk.layer + 1) { | 332 else if (i === desk.layer + 1) { |
350 } | 351 } |
351 else { | 352 else { |
352 value = records[0].get('sn'); | 353 value = records[0].get('sn'); |
353 } | 354 } |
354 current[desk.layer + 1] = value; | 355 current[desk.layer + 1] = value; |
356 if (desk.layer < 2) { | |
357 for (var i = desk.layer + 2; i < 12; i++) { | |
358 current[i] = '00'; | |
359 } | |
360 this.clearChildDesk(desk); | |
361 } | |
362 else if (desk.layer === 2 && current[1] === '01') { | |
363 current[4] = '00'; | |
364 desk.up('fieldset').down('deskriptor[layer=3]').clearValue(); | |
365 } | |
355 } | 366 } |
356 media.setValue(current.join(' ').trim()); | 367 media.setValue(current.join(' ').trim()); |
357 }, | 368 }, |
358 | 369 |
359 clearChildDesk: function(field, media) { | 370 clearChildDesk: function(field) { |
360 var allS = field.up('fieldset').items.items; | 371 var allS = field.up('fieldset').items.items; |
361 for (var i = field.layer + 1; i < 12; i++) { | 372 for (var i = field.layer + 1; i < 12; i++) { |
362 allS[i].clearValue(); | 373 allS[i].clearValue(); |
363 media[i + 1] = '00'; | |
364 } | 374 } |
365 } | 375 } |
376 | |
377 | |
366 }); | 378 }); |