Open = "1" for dhtmlxConnector + dhtmlxtree

i have successfully setup dhtmlxConnector service side along with dhtmlxtree to display a table of data. Some of the nodes need to be open depending on the data within the database. I can’t seem to find a way to achieve this looking at the options allowed via the tree_connector.php.

I know you can achieve this within a normal xml file by adding open=1 to the related node but is there a database replacement for this? Also could not find any connector samples showing a tree with any nodes open by default.

You can use set_attribute method to define open state:

function formatting($item){ /*your code here*/ $item->set_attribute("open","1"); } $tree->event->attach("beforeRender","formatting");

See details in the documentation … re_loading

Exactly what i was looking for thank you.