treegrid: expandAll if nothing from loadOpenStates

what I want is that, tree grid shows in all expanded (first time) if there is nothing returned from loadOpenStates.

I am using load and save open states but very first time when user visits he sees all nodes open by default rather than all closed. How to do it?

To expand all nodes in dhtmlxTreeGrid you can use expandAll() method

problem is expandAll() overrides loadOpenStates()

I want some thing like this,

if there is no open states cookie, then expandAll() else load open states from cookie. How do I do it?

psuedo code of what I want, not real code.

if (not grid.loadOpenStates()){

It can be done only with code modification. Please open ticket at and we’ll provide you workaround