PDA

View Full Version : TreeNode errors in IE8



stinkycheeseman
29 Jun 2010, 8:07 AM
I have a custom function that extends XMLTreeLoader but it's not working in IE8 (though it does work in Chrome and Firefox). I have a try/catch block that tells me the error that I'm getting:

"Wrong number of arguments or invalid property assignment"

The loop in this function is not getting called:

parseXml : function(node) {
var nodes = [];
Ext.each(node.childNodes, function(n){
if(n.nodeType == this.XML_NODE_ELEMENT){
var treeNode = this.createNode(n);
if(n.childNodes.length > 0){
var child = this.parseXml(n);
if(typeof child == 'string'){
treeNode.attributes.innerText = child;
}else{
treeNode.appendChild(child);
}
}
nodes.push(treeNode);
}
else if(n.nodeType == this.XML_NODE_TEXT){
var text = n.nodeValue.trim();
if(text.length > 0){
return nodes = text;
}
}
}, this);

return nodes;
}

I'm assuming I'm either
a) calling Ext.each improperly
or
b) calling node.ChildNodes improperly

Does anyone have any ideas on how I can fix this to work in IE?