comparison app/controller/form/Messprogramm.js @ 842:beef4e8eeafc

Added logic to autofill the Netzbetreiber when the Messstelle was selected.
author Dustin Demuth <dustin@intevation.de>
date Tue, 07 Jul 2015 09:55:37 +0200
parents 097d4edc2f00
children 05124d559e59
comparison
equal deleted inserted replaced
841:cf35c6305370 842:beef4e8eeafc
33 'messprogrammform': { 33 'messprogrammform': {
34 dirtychange: this.dirtyForm 34 dirtychange: this.dirtyForm
35 }, 35 },
36 'messprogrammform messstelle combobox':{ 36 'messprogrammform messstelle combobox':{
37 expand: this.filter, 37 expand: this.filter,
38 keydown: this.filter 38 keydown: this.filter,
39 select: this.setNetzbetreiber
39 }, 40 },
40 'messprogrammform location combobox': { 41 'messprogrammform location combobox': {
41 select: this.syncOrtWindow 42 select: this.syncOrtWindow
42 }, 43 },
43 'messprogrammform datetime textfield': { 44 'messprogrammform datetime textfield': {
73 } 74 }
74 return false; 75 return false;
75 } 76 }
76 }); 77 });
77 field.getStore().filter(fil); 78 field.getStore().filter(fil);
79 },
80
81 /**
82 * When a Messtelle is selected, modify the Netzbetreiber
83 * according to the Messstelle
84 * TODO: The conditions when to apply this automatism are still
85 * unclear. Right now it is only applied when the NB is not set.
86 */
87 setNetzbetreiber: function(combo, records){
88 var netzbetreiber = combo.up().up('form')
89 .down('netzbetreiber').down('combobox');
90 var nbId = records[0].get('netzbetreiberId');
91
92 debugger;
93 if (nbId != null &&
94 (netzbetreiber.value === '' || netzbetreiber.value === null)) {
95 //select the NB in the NB-Combobox
96 netzbetreiber.select(nbId);
97 }
78 }, 98 },
79 99
80 /** 100 /**
81 * When the Probenintervall was changed, update the Sliders 101 * When the Probenintervall was changed, update the Sliders
82 * and the the numberfield. 102 * and the the numberfield.

http://lada.wald.intevation.org