Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Erik on Mar 31, 2008 03:04
open dhtmlx forum
id=0 ?

Hello,

When I assign id=0 to a tree item, it's changed to a random id like 0_12069575111948.

Is it not possible to use the id 0?

Kind regards,

Erik
Answer posted by Support on Mar 31, 2008 04:01
By default tree uses ID = 0, as ID of super root item ( virtual top level element, parent of visible hierarchy )
When you adding item to tree with not-unique ID , ID will be automatically changed to unique one.

Basically you can define any other super root ID ( 4th parameter of constructor ) , in such case ID=0 can be used for normal item.
Answer posted by Erik on Mar 31, 2008 04:17
Thanks for the answer. But is this also possible when I use dhtmlXTreeFromHTML()?
Answer posted by Support on Mar 31, 2008 04:56
When you init tree from HTML markup, it always has 0 as super root ID, it can be changed only by code modification.

dhtmlxtree_start.js, line 24
    var t=new dhtmlXTreeObject(obj,"100%","100%",0);