Mercurial > lada > lada-client
comparison app/controller/form/Ortszuordnung.js @ 1341:2e8eba3918b1
OrtszuordnungMp fix
author | Maximilian Krambach <mkrambach@intevation.de> |
---|---|
date | Fri, 03 Feb 2017 21:43:52 +0100 |
parents | 1a2cd9bef6d7 |
children | cd16b30dbc10 |
comparison
equal
deleted
inserted
replaced
1340:15e4a3e42ad7 | 1341:2e8eba3918b1 |
---|---|
110 var form = button.up('form'); | 110 var form = button.up('form'); |
111 var osg = button.up('window').down('ortstammdatengrid'); | 111 var osg = button.up('window').down('ortstammdatengrid'); |
112 var recordData = form.getForm().getRecord().data; | 112 var recordData = form.getForm().getRecord().data; |
113 var currentOrt = null; | 113 var currentOrt = null; |
114 if (recordData.ortId !== undefined) { | 114 if (recordData.ortId !== undefined) { |
115 currentOrt = recordData.ortId; | 115 currentOrt = recordData.ortId[0]; |
116 } else { | 116 } else { |
117 currentOrt = recordData.ort; | 117 currentOrt = recordData.ort; |
118 } | 118 } |
119 var record = osg.store.getById(currentOrt); | 119 var record = osg.store.getById(currentOrt); |
120 var selmod = osg.getView().getSelectionModel(); | 120 var selmod = osg.getView().getSelectionModel(); |
189 * The validitychange function enables or disables the save button which | 189 * The validitychange function enables or disables the save button which |
190 * is present in the toolbar of the form. | 190 * is present in the toolbar of the form. |
191 */ | 191 */ |
192 validityChange: function(form, valid) { | 192 validityChange: function(form, valid) { |
193 if (form.isDirty()) { | 193 if (form.isDirty()) { |
194 if (valid) { | 194 form.owner.down('button[action=revert]').setDisabled(false); |
195 if (form.getValues().ortId !== '' | 195 if (valid && form.getValues().ortId !== '') { |
196 && /[UEZA]/.test(form.getValues().ortszuordnungTyp)) { | 196 form.owner.down('button[action=save]').setDisabled(false); |
197 // valid ortzuordnung(Probe) | |
198 form.owner.down('button[action=save]').setDisabled(false); | |
199 } else if (form.getValues().ort !== '' | |
200 && /[UEZA]/.test(form.getValues().ortsTyp)) { | |
201 // valid ortzuordnung(messprogramm) | |
202 form.owner.down('button[action=save]').setDisabled(false); | |
203 } else { | |
204 form.owner.down('button[action=save]').setDisabled(true); | |
205 } | |
206 } else { | 197 } else { |
207 //invalid | |
208 form.owner.down('button[action=save]').setDisabled(true); | 198 form.owner.down('button[action=save]').setDisabled(true); |
209 } | 199 } |
210 } else { | 200 } else { |
211 //not dirty | 201 //not dirty |
212 form.owner.down('button[action=save]').setDisabled(true); | 202 form.owner.down('button[action=save]').setDisabled(true); |
203 form.owner.down('button[action=revert]').setDisabled(true); | |
213 } | 204 } |
214 } | 205 } |
215 }); | 206 }); |