Adding top level node with empty tree

Hey all,

I was wondering, is there a way to programatically add a top level node to an empty tree? The example on this page doesn’t allow any deletion if all the nodes have been removed previously.

Thanks.

Hi,

you may use insertNewChild method to add item to the root:

tree.insertNewChild(0,1,“Root node”);

Here is the sample:

dhtmlx.com/docs/products/dhtmlxT … _item.html

Thanks a lot!