Mercurial > lada > lada-client
comparison app/view/widgets/LadaForm.js @ 211:401d559e0461
Fix rendering the form readonly.
author | Torsten Irländer <torsten.irlaender@intevation.de> |
---|---|
date | Fri, 12 Jul 2013 15:56:41 +0200 |
parents | 214d1b274a50 |
children | cf83b382dc02 |
comparison
equal
deleted
inserted
replaced
210:f3a2f985f451 | 211:401d559e0461 |
---|---|
58 | 58 |
59 bindModel: function(model) { | 59 bindModel: function(model) { |
60 this.model = model; | 60 this.model = model; |
61 this.loadRecord(model); | 61 this.loadRecord(model); |
62 // Set the form to readonly if the models readonly attribute is | 62 // Set the form to readonly if the models readonly attribute is |
63 // anything dffernt from true | 63 // true |
64 if (model.get('readonly') !== false) { | 64 if (model.get('readonly') === true) { |
65 this.setReadOnly(true); | 65 this.setReadOnly(true); |
66 } | 66 } |
67 }, | 67 }, |
68 | 68 |
69 commit: function(callback, scope) { | 69 commit: function(callback, scope) { |
129 this.success = json.success; | 129 this.success = json.success; |
130 this.errors = this.translateReturnCodes(json.errors); | 130 this.errors = this.translateReturnCodes(json.errors); |
131 this.warnings = this.translateReturnCodes(json.warnings); | 131 this.warnings = this.translateReturnCodes(json.warnings); |
132 this.message = Lada.getApplication().bundle.getMsg(json.message); | 132 this.message = Lada.getApplication().bundle.getMsg(json.message); |
133 } else { | 133 } else { |
134 this.setReadOnly(true); | 134 this.setReadOnly(this.model.get('readonly')); |
135 } | 135 } |
136 } | 136 } |
137 }); | 137 }); |