dynamic loading and loadOpenStates

Hi!

Im using professional version of dhtmlxgrid. My TreeGrid is set to dynamic loading. In Tree component method loadOpenStates works ok, but in treegrid only first level of elements are opening after launching loadOpenStates. So i try something like this:

treegrid.attachEvent( "onXLE", function(){ treegrid.loadOpenStates('foo') });

It works fine only if one branch is saved, but when we had saved more branches it will fire loadOpenStates right after open first saved element (in first branch), and another request for second branch is send (second time) - and this cause errors. What shoud we do to safetly reopen saved state in dynamic treegrid?

Existing version of TreeGrid , can’t fetch multiple branches in the same time, when auto-loading mode is used.

If you need a patch, which will allow such functionality - please open ticket at support.dhtmlx.com

Damn. So there is my solution for this problem (not very fancy but working :slight_smile:)

var lock = false; treegrid.attachEvent("onDynXLS",function(start,count){ if(lock == true) return false; else { lock = true; treegrid.load("/xml?id="+start); } }); treegrid.attachEvent("onXLE",function(){ lock = false; treegrid.loadOpenStates('foo'); });

With this code there will be only one request at one time. Maybe someone find it useful :slight_smile:

Existing version of TreeGrid , can’t fetch multiple branches in the same time, when auto-loading mode is used.

I’m using Version 3.6.0 latest version. Still the same issue occur.
any alternate solution ?

Unfortunately - there is no better solution.
If you are using dynamical loading and loadOpenStates in the same time, treegrid will not be able to load and show all branches. ( each functionality works correctly on its own, but they can’t be used both in same time )