Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Jap on Dec 30, 2007 15:00
open dhtmlx forum
dhtmltree, open items from an id list

I try display a tree with preselected items. Because I have a large tree, I selected to use dynamic loading.

Know the problem is that when I write this:

var tree=new dhtmlXTreeObject('tree',"100%","100%",0);
tree.setImagePath("../../imgs/");

//load root level from xml
tree.loadXML("./xml.asp?id=0");
tree.setXMLAutoLoading("./xml.asp");

tree.openAllItemsDynamic();
tree.openItemsDynamic("0_1,0_1_1,0_1_1_1",true)

...this will raise an error, because the initial tree is still loading!!!!

How can I display the tree at a defined position after loading the page?

Thanks a lot and...
Happy New Year!
Answer posted by Support on Jan 14, 2008 08:38
You can catch loading end event by using onXLE event of tree, or by next syntax

tree.loadXML(url,function(id){
    //any code here
    tree.openItemsDynamic("0_1,0_1_1,0_1_1_1",true)
});