Mercurial > lada > lada-client
diff app/view/widgets/LadaForm.js @ 228:08144d625b2b
Only iterate over fields of the form is readonly. This increases the
performance.
author | Torsten Irländer <torsten.irlaender@intevation.de> |
---|---|
date | Wed, 17 Jul 2013 11:06:47 +0200 |
parents | cf83b382dc02 |
children | 82118c01bc52 |
line wrap: on
line diff
--- a/app/view/widgets/LadaForm.js Wed Jul 17 10:58:03 2013 +0200 +++ b/app/view/widgets/LadaForm.js Wed Jul 17 11:06:47 2013 +0200 @@ -119,14 +119,16 @@ }, 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); + if (bReadOnly) { + this.getForm().getFields().each (function (field) { + //field.setDisabled(bReadOnly); + field.setReadOnly(true); + }); + /* 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) {