Mercurial > lada > lada-client
diff 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 |
line wrap: on
line diff
--- a/app/view/widgets/LadaForm.js Mon Jul 15 17:51:28 2013 +0200 +++ b/app/view/widgets/LadaForm.js Tue Jul 16 09:59:25 2013 +0200 @@ -118,10 +118,16 @@ return translated; }, setReadOnly: function (bReadOnly) { + /* Iterate over all fields and set them readonly */ this.getForm().getFields().each (function (field) { //field.setDisabled(bReadOnly); field.setReadOnly(bReadOnly); }); + /* Iterate over all toolbars of lists and hide them */ + var childs = this.query('toolbar'); + for (var i = childs.length - 1; i >= 0; i--){ + childs[i].setVisible(false); + } }, parseResponse: function(response) { var json = Ext.decode(response.responseText);