PDA

View Full Version : Making form fields read only not working in IE



sanjay_1985
26 Dec 2013, 9:37 PM
Hi,
We are trying to make all form fields read only dynamically using the following code


Ext.getCmp('formId').query('.field').forEach(function(c){c.setReadOnly(true);});
Ext.getCmp('formId').query('.button').forEach(function(c){c.setDisabled(true);});



This code is not working in IE8.
Can somebody help me out with a solution to this problem?

droessner
27 Dec 2013, 6:52 AM
IE8 does not implement the forEach method on Array's natively.

This should fix it:


Ext.Array.forEach(Ext.getCmp('formId').query('.field'),function(c){c.setReadOnly(true);});
Ext.Array.forEach(Ext.getCmp('formId').query('.button'),function(c){c.setDisabled(true);});

sanjay_1985
1 Jan 2014, 8:17 PM
Thanks droessner