DHTMLX Tree - restoreSelectedItem() doesn't work!!! (it work

This is my code:

tree=new dhtmlXTreeObject(‘treepanel’,“100%”,“100%”,0);




tree.loadXML("/be3a5/GUI/content/xml/dyntree.xml?id=0&country=" + parent.actualCountry,function(){

tree.loadOpenStates(“CNT” + parent.actualCountry,cb);


tree.restoreSelectedItem(“CNT” + parent.actualCountry);


tree.saveOpenStates(“CNT” + parent.actualCountry);

The function restore selectedItem dosn’t work because when is activate, the loadOpenStates function is again expanding the tree…

Is it possible to add a callback?



Updated version of dhtmlxtree_xw.js sent by email, it introduce new event “onAllOpenDynamic” which will fire after all necessary items loaded and expanded , so you can use

tree.attachEvent(“onAllOpenDynamic”, function(){ //will be called after loadOpenStates finished
tree.restoreSelectedItem(“CNT” + parent.actualCountry);
tree.loadOpenStates(“CNT” + parent.actualCountry,cb);

There wasn’t an attachment with the new js file updated.

The email was sent to the address which was used for post creating.
If you still has not receive it - please contact us directly at support@dhtmlx.com