Mercurial > lada > lada-client
comparison app/controller/form/Messprogramm.js @ 1210:a24de34d6423
Align subintervall with validity for yearly samples.
Subintervall is redundant to validity for yearly samples.
author | Tom Gottfried <tom@intevation.de> |
---|---|
date | Tue, 11 Oct 2016 14:34:12 +0200 |
parents | 3b6f40541ac6 |
children | 4270da0f7d3b |
comparison
equal
deleted
inserted
replaced
1209:78805e951c37 | 1210:a24de34d6423 |
---|---|
49 change: this.synchronizeSlider, | 49 change: this.synchronizeSlider, |
50 }, | 50 }, |
51 'messprogrammform probenintervall combobox': { | 51 'messprogrammform probenintervall combobox': { |
52 select: this.updateIntervalls | 52 select: this.updateIntervalls |
53 }, | 53 }, |
54 'messprogrammform dayofyear [hidden]': { | |
55 change: this.alignSubIntervall | |
56 }, | |
54 'messprogrammform panel[xtype="deskriptor] combobox': { | 57 'messprogrammform panel[xtype="deskriptor] combobox': { |
55 select: this.deskriptorSelect | 58 select: this.deskriptorSelect |
56 } | 59 } |
57 }); | 60 }); |
58 }, | 61 }, |
88 } | 91 } |
89 }, | 92 }, |
90 | 93 |
91 /** | 94 /** |
92 * When the Probenintervall was changed, update the Sliders | 95 * When the Probenintervall was changed, update the Sliders |
93 * and the the numberfield. | 96 * and the numberfield. |
94 */ | 97 */ |
95 updateIntervalls: function(field, records) { | 98 updateIntervalls: function(field) { |
96 var form = field.up('messprogrammform'); | 99 var form = field.up('messprogrammform'); |
97 var record = form.getRecord(); | 100 var record = form.getRecord(); |
98 form.populateIntervall(record, field.getValue()); | 101 form.populateIntervall(record, field.getValue()); |
102 }, | |
103 | |
104 /** | |
105 * When the validity period was changed, align the subintervall | |
106 * in case of yearly intervall. | |
107 */ | |
108 alignSubIntervall: function(field) { | |
109 var form = field.up('messprogrammform'); | |
110 var intervall = form.down('probenintervall').down('combobox') | |
111 .getValue(); | |
112 if (intervall == 'J') { | |
113 if (field.getName() == 'gueltigVon') { | |
114 form.down('[name=teilintervallVon]') | |
115 .setValue(field.getValue()); | |
116 } else { | |
117 form.down('[name=teilintervallBis]') | |
118 .setValue(field.getValue()); | |
119 } | |
120 } | |
99 }, | 121 }, |
100 | 122 |
101 /** | 123 /** |
102 * The function will open a new Window to edit the Ort of a Messprogramm | 124 * The function will open a new Window to edit the Ort of a Messprogramm |
103 */ | 125 */ |
237 } | 259 } |
238 }); | 260 }); |
239 }, | 261 }, |
240 | 262 |
241 /** | 263 /** |
242 * The discard function resets the Location form | 264 * The discard function resets the form |
243 * to its original state. | 265 * to its original state. |
244 */ | 266 */ |
245 discard: function(button) { | 267 discard: function(button) { |
246 var formPanel = button.up('form'); | 268 var formPanel = button.up('form'); |
247 formPanel.getForm().loadRecord(formPanel.getForm().getRecord()); | 269 formPanel.getForm().loadRecord(formPanel.getForm().getRecord()); |