Mercurial > lada > lada-client
comparison app/controller/form/Probe.js @ 841:cf35c6305370
Added logic to autofill the Netzbetreiber when the Messstelle was selected.
author | Dustin Demuth <dustin@intevation.de> |
---|---|
date | Tue, 07 Jul 2015 09:37:34 +0200 |
parents | ebc275959f81 |
children | 05124d559e59 |
comparison
equal
deleted
inserted
replaced
840:dd9b77e2532b | 841:cf35c6305370 |
---|---|
27 'probeform': { | 27 'probeform': { |
28 dirtychange: this.dirtyForm | 28 dirtychange: this.dirtyForm |
29 }, | 29 }, |
30 'probeform messstelle combobox':{ | 30 'probeform messstelle combobox':{ |
31 expand: this.filter, | 31 expand: this.filter, |
32 keydown: this.filter | 32 keydown: this.filter, |
33 select: this.setNetzbetreiber | |
33 }, | 34 }, |
34 'probeform [xtype="datetime"] field': { | 35 'probeform [xtype="datetime"] field': { |
35 blur: this.checkDate | 36 blur: this.checkDate |
36 }, | 37 }, |
37 'probeform panel[xtype="deskriptor] combobox': { | 38 'probeform panel[xtype="deskriptor] combobox': { |
53 } | 54 } |
54 return false; | 55 return false; |
55 } | 56 } |
56 }); | 57 }); |
57 field.getStore().filter(fil); | 58 field.getStore().filter(fil); |
59 }, | |
60 | |
61 /** | |
62 * When a Messtelle is selected, modify the Netzbetreiber | |
63 * according to the Messstelle | |
64 * TODO: The conditions when to apply this automatism are still | |
65 * unclear. Right now it is only applied when the NB is not set. | |
66 */ | |
67 setNetzbetreiber: function(combo, records){ | |
68 var netzbetreiber = combo.up().up('form') | |
69 .down('netzbetreiber').down('combobox'); | |
70 var nbId = records[0].get('netzbetreiberId'); | |
71 | |
72 debugger; | |
73 if (nbId != null && | |
74 (netzbetreiber.value === '' || netzbetreiber.value === null)) { | |
75 //select the NB in the NB-Combobox | |
76 netzbetreiber.select(nbId); | |
77 } | |
58 }, | 78 }, |
59 | 79 |
60 /** | 80 /** |
61 * The save function saves the content of the Location form. | 81 * The save function saves the content of the Location form. |
62 * On success it will reload the Store, | 82 * On success it will reload the Store, |