Mercurial > lada > lada-client
diff app/view/widgets/LadaForm.js @ 189:214d1b274a50
As the model now should have a readonly flag, the check if the form must be
rendered as readonly was moved to the place where the model is actually bound
to the form.
author | Torsten Irländer <torsten.irlaender@intevation.de> |
---|---|
date | Fri, 05 Jul 2013 14:49:15 +0200 |
parents | 0fcec0c8c072 |
children | 401d559e0461 |
line wrap: on
line diff
--- a/app/view/widgets/LadaForm.js Fri Jul 05 14:47:19 2013 +0200 +++ b/app/view/widgets/LadaForm.js Fri Jul 05 14:49:15 2013 +0200 @@ -59,6 +59,11 @@ bindModel: function(model) { this.model = model; this.loadRecord(model); + // Set the form to readonly if the models readonly attribute is + // anything dffernt from true + if (model.get('readonly') !== false) { + this.setReadOnly(true); + } }, commit: function(callback, scope) { @@ -125,7 +130,6 @@ this.errors = this.translateReturnCodes(json.errors); this.warnings = this.translateReturnCodes(json.warnings); this.message = Lada.getApplication().bundle.getMsg(json.message); - this.setReadOnly(json.readonly); } else { this.setReadOnly(true); }