Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Ben on Feb 21, 2009 20:44
open dhtmlx forum
setcheck onOpenDynamicEnd stack overflow IE7

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.

Answer posted by Support on Feb 23, 2009 07:37
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);
})
Answer posted on Feb 24, 2009 14:18
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");
Answer posted on Feb 24, 2009 14:31
Says Stack Overflow at Line 24 in IE7
Answer posted on Feb 24, 2009 15:13
Think I narrowed it down to the code for you, see here:
http://www.dhtmlx.com/docs/products/kb/index.php?s=normal&q=3924

Answer posted by Support on Feb 25, 2009 05:57
Fixed js file sent by email.