Mercurial > lada > lada-client
comparison 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 |
comparison
equal
deleted
inserted
replaced
227:d3f4a39bf89e | 228:08144d625b2b |
---|---|
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 /* Iterate over all fields and set them readonly */ |
122 this.getForm().getFields().each (function (field) { | 122 if (bReadOnly) { |
123 //field.setDisabled(bReadOnly); | 123 this.getForm().getFields().each (function (field) { |
124 field.setReadOnly(bReadOnly); | 124 //field.setDisabled(bReadOnly); |
125 }); | 125 field.setReadOnly(true); |
126 /* Iterate over all toolbars of lists and hide them */ | 126 }); |
127 var childs = this.query('toolbar'); | 127 /* Iterate over all toolbars of lists and hide them */ |
128 for (var i = childs.length - 1; i >= 0; i--){ | 128 var childs = this.query('toolbar'); |
129 childs[i].setVisible(false); | 129 for (var i = childs.length - 1; i >= 0; i--){ |
130 childs[i].setVisible(false); | |
131 } | |
130 } | 132 } |
131 }, | 133 }, |
132 parseResponse: function(response) { | 134 parseResponse: function(response) { |
133 var json = Ext.decode(response.responseText); | 135 var json = Ext.decode(response.responseText); |
134 if (json) { | 136 if (json) { |