Tree Methods not Executing After Initialization


I am having a very strange problem with the method calls for the trees not executing properly. For example, after initializing the tree, I call a function, merely for testing purposes, to see if I get returned the expected values; this tree is one of the examples provided in the download package.

			tree=new dhtmlXTreeObject("treeboxbox_tree","100%","100%",0);
			document.write(tree.getAllItemsWithKids() + 'test');

Although the tree displayed shows that many nodes have kids, this returns nothing but my ‘test’ string. I noticed this problem after I could no longer preset some of the nodes to a checked state and I tested these other methods to see if I could get anything useful as to why it was not working.

It’s interesting to note that although it does not work immediately after the tree has been created, when I call the functions with onClicks, they do work.

Thank you for any information that could resolve this issue.


methods that operate items should be called from “loading end” handler:


function doAfterLoading(){
document.write(tree.getAllItemsWithKids() + ‘test’);

Thank you very much – the issue has been resolved with your help.