Mercurial > lada > lada-client
comparison app/view/widgets/LadaForm.js @ 221:cf83b382dc02
setReadOnly now also iterates over the toolbars within the form and hide them
if the form is marked as readonly
author | Torsten Irländer <torsten.irlaender@intevation.de> |
---|---|
date | Tue, 16 Jul 2013 09:59:25 +0200 |
parents | 401d559e0461 |
children | 08144d625b2b |
comparison
equal
deleted
inserted
replaced
220:8e41a5a6cb7f | 221:cf83b382dc02 |
---|---|
116 translated[k] = Lada.getApplication().bundle.getMsg(codes[k]); | 116 translated[k] = Lada.getApplication().bundle.getMsg(codes[k]); |
117 } | 117 } |
118 return translated; | 118 return translated; |
119 }, | 119 }, |
120 setReadOnly: function (bReadOnly) { | 120 setReadOnly: function (bReadOnly) { |
121 /* Iterate over all fields and set them readonly */ | |
121 this.getForm().getFields().each (function (field) { | 122 this.getForm().getFields().each (function (field) { |
122 //field.setDisabled(bReadOnly); | 123 //field.setDisabled(bReadOnly); |
123 field.setReadOnly(bReadOnly); | 124 field.setReadOnly(bReadOnly); |
124 }); | 125 }); |
126 /* Iterate over all toolbars of lists and hide them */ | |
127 var childs = this.query('toolbar'); | |
128 for (var i = childs.length - 1; i >= 0; i--){ | |
129 childs[i].setVisible(false); | |
130 } | |
125 }, | 131 }, |
126 parseResponse: function(response) { | 132 parseResponse: function(response) { |
127 var json = Ext.decode(response.responseText); | 133 var json = Ext.decode(response.responseText); |
128 if (json) { | 134 if (json) { |
129 this.success = json.success; | 135 this.success = json.success; |