dhtmlxtree resize

Hello there !

I would like to add whitespace to the bottom of a dhtmlxtree. At constructor time, if I set the height of the dhtmlxtree to more than what is required, then I get the desired effect. What I need is to be able to add items to the tree dynamically, obtain the new height, then increase it slightly so I have the whitespace after it. Here’s a bit of pseudocode:

tree = new dhtmlXTreeObject(document.getElementById(‘archivetree’),“200”,“0”,0);


tree.setItemStyle(1," font: 11px Tahoma, Arial;");



tree.setItemStyle(2," font: 11px Tahoma, Arial;");


// Here I want code to obtain the new height of the tree

// And here I want to add 20px to the height

// And here I want to set the extended height of tree so it displays with whitespace at the bottom !

I hope this is enough information.


You can try to call the following function when a new row is added:

function correct(){
        var cont=document.getElementById(“archivetree”);
        cont.style.height=cont.firstChild.firstChild.scrollHeight + “px”;