Reputation: 8498
This code not working in Internet Explorer 8.
documenttab.query('.field,.button').forEach(function(c){c.setDisabled(false);});
I get the error SCRIPT438: Object doesn't support property or method 'forEach'
Upvotes: 6
Views: 8146
Reputation: 1196
Mozilla also publishes code for methods which you can put near the top of your JS and it will create them if they don't exist.
https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/forEach
Upvotes: 5
Reputation: 3367
I believe this should solve your issue.
vals = documenttab.query('.field,.button')
for (i = 0; i < vals.length; i++) {
vals[i].setDisabled(false);
}
Upvotes: 4
Reputation: 30082
Ext has a forEach method. Where supported, it will defer to the native method:
http://docs.sencha.com/ext-js/4-1/#!/api/Ext.Array-method-forEach
Ext.Array.forEach(documenttab.query('.field,.button'), function(c){
c.setDisabled(false);
});
Upvotes: 3