If we use setCheck on an ID that does not exist on the “onOpenDynamicEnd” event we get a stack overflow in IE7.
It works fine for ID’s that do exist.
Usage of command with non-existing ID doesn’t look as correct operation in first place.
We will check the reasons of such behavior, as fast solution you can try to use
tree.attachEvent(“onOpenDynamicEnd”,function(){
window.setTimeout(function(){
//isolated from OpenEnd event
tree.setCheck(…
},1);
})
It is still locking up in firefox, and causing a stack overflow in IE7.
I was wrong before. Every setCheck item we does exist. It seems to fail for some other reason.
I did some troubleshooting and removed the setCheck code. It still fails (locks up on trying to load the 4th ID).
All ajax calls (all 4 of them) are getting made properly for the openItemsDynamic call.
Here is the code:
tree = new dhtmlXTreeObject(‘test’,“100%”,“100%”,0);
tree.setImagePath("/tree/images/");
tree.enableIEImageFix(true);
tree.enableCheckBoxes(true);
tree.enableMultiLineItems(true);
tree.enableTreeLines(false);
tree.attachEvent(“onCheck”,function(nodeId) {
document.getElementById(‘test_items’).value = categories_tree.getAllChecked();
});
tree.attachEvent(“onClick”,function(nodeId) {
tree.setCheck(nodeId,!tree.isItemChecked(nodeId));
document.getElementById(‘test_items’).value = tree.getAllChecked();
});
tree.attachEvent(“onXLE”,function() {
tree.openItemsDynamic(“2,95,94,4”);
tree.attachEvent(“onOpenDynamicEnd”,function(){
window.setTimeout(function(){
tree.setCheck(10,true);
tree.setCheck(82,true);
tree.setCheck(89,true);
tree.setCheck(109,true);
tree.setCheck(138,true);
},1);
});
});
tree.attachEvent(“onOpenStart”, function (id, state) {
tree.setItemImage(id, “loading.gif”,“loading.gif”);
return true;
});
tree.attachEvent(“onOpenEnd”, function(id, state) {
tree.setItemImage(id, “folderOpen.gif”,“folderClosed.gif”);
});
tree.setXMLAutoLoading(“xml.php”);
tree.loadXML(“xml.php”);
Says Stack Overflow at Line 24 in IE7
Fixed js file sent by email.