ISSue with tree


Iam using dhtmltree and grid in my code.

I used 2 dropdowns.while selecting those dropdown tree and grid are displayed.

If i change value of dropdown new tree and grid are came.

For that i am using the following code.

if(tree != null && typeof(tree) != “undefined”){



if(mygrid != null && typeof(mygrid) != “undefined”){

//destructor, removes grid and cleans used memory


mygrid = null;


In jsp i used 2 divs for displaying tree and grid.the code is given below

I want to use tree.destructor() function in my code same as grid.distructor().

If i used it intially it is loading correctly.

But after changing the value in drop down

the tree is populated in the bottom of the “treebox_tree” div.grid is diplaying correctly.

why it is happening?

Please provide me solution how can i use destructor() function for tree?

Please send me soltion asap.




The issue with tree destructor was fixed in the latest tree version. You can try to use following approach to fix it in tree 1.6:


tree.parentObject.innerHTML=""; /or the same - document.getElementById(“treebox_tree”).innerHTML="";/