comparison app/view/window/MessungEdit.js @ 996:bf7bb9583a40

Statusworkflow: More work on the reset Button
author Dustin Demuth <dustin@intevation.de>
date Fri, 08 Jan 2016 14:34:27 +0100
parents a2c2039bb5d9
children c943340176d4
comparison
equal deleted inserted replaced
995:fb424948de02 996:bf7bb9583a40
176 this.enableStatusEdit(); 176 this.enableStatusEdit();
177 } 177 }
178 else { 178 else {
179 this.disableStatusEdit(); 179 this.disableStatusEdit();
180 } 180 }
181 //Check if it is allowed to reset Status
182 // TODO additional requirements?
183 if (this.record.get('statusEdit') === true) {
184 this.enableStatusReset();
185 }
186 else {
187 this.disableStatusReset();
188 }
181 }, 189 },
182 scope: this 190 scope: this
183 }); 191 });
184 }, 192 },
185 193
208 this.down('fset[name=messwerte]').down('messwertgrid').setReadOnly(true); 216 this.down('fset[name=messwerte]').down('messwertgrid').setReadOnly(true);
209 this.down('fset[name=messwerte]').down('messwertgrid').readOnly = true; 217 this.down('fset[name=messwerte]').down('messwertgrid').readOnly = true;
210 this.down('fset[name=messungskommentare]').down('mkommentargrid').setReadOnly(true); 218 this.down('fset[name=messungskommentare]').down('mkommentargrid').setReadOnly(true);
211 this.down('fset[name=messungskommentare]').down('mkommentargrid').readOnly = true; 219 this.down('fset[name=messungskommentare]').down('mkommentargrid').readOnly = true;
212 this.disableStatusEdit(); 220 this.disableStatusEdit();
221 this.disableStatusReset();
213 }, 222 },
214 223
215 /** 224 /**
216 * Enable the Childelements of this window 225 * Enable the Childelements of this window
217 */ 226 */
219 this.down('fset[name=messwerte]').down('messwertgrid').setReadOnly(false); 228 this.down('fset[name=messwerte]').down('messwertgrid').setReadOnly(false);
220 this.down('fset[name=messwerte]').down('messwertgrid').readOnly = false; 229 this.down('fset[name=messwerte]').down('messwertgrid').readOnly = false;
221 this.down('fset[name=messungskommentare]').down('mkommentargrid').setReadOnly(false); 230 this.down('fset[name=messungskommentare]').down('mkommentargrid').setReadOnly(false);
222 this.down('fset[name=messungskommentare]').down('mkommentargrid').readOnly = false; 231 this.down('fset[name=messungskommentare]').down('mkommentargrid').readOnly = false;
223 this.enableStatusEdit(); 232 this.enableStatusEdit();
224 }, 233 this.enableStatusReset();
225 234 },
235
236 /**
237 * Enable to reset the statusgrid
238 */
239 enableStatusReset: function() {
240 this.down('fset[name=messungstatus]').down('statusgrid').setResetable(true);
241 },
242
243 /**
244 * Disable to reset the statusgrid
245 */
246 disableStatusReset: function() {
247 this.down('fset[name=messungstatus]').down('statusgrid').setResetable(false);
248 },
226 /** 249 /**
227 * Enable to edit the statusgrid 250 * Enable to edit the statusgrid
228 */ 251 */
229 enableStatusEdit: function () { 252 enableStatusEdit: function() {
230 this.down('fset[name=messungstatus]').down('statusgrid').setReadOnly(false); 253 this.down('fset[name=messungstatus]').down('statusgrid').setReadOnly(false);
231 this.down('fset[name=messungstatus]').down('statusgrid').readOnly = false; 254 this.down('fset[name=messungstatus]').down('statusgrid').readOnly = false;
232 }, 255 },
233 256
234 /** 257 /**
235 * Disable to edit the statusgrid 258 * Disable to edit the statusgrid
236 */ 259 */
237 disableStatusEdit: function () { 260 disableStatusEdit: function() {
238 this.down('fset[name=messungstatus]').down('statusgrid').setReadOnly(true); 261 this.down('fset[name=messungstatus]').down('statusgrid').setReadOnly(true);
239 this.down('fset[name=messungstatus]').down('statusgrid').readOnly = true; 262 this.down('fset[name=messungstatus]').down('statusgrid').readOnly = true;
240 }, 263 },
241 264
242 /** 265 /**

http://lada.wald.intevation.org