This is my code:
tree=new dhtmlXTreeObject(‘treepanel’,“100%”,“100%”,0);
tree.setImagePath("/be3a5/GUI/content/imgs/tree/");
tree.setOnClickHandler(openFolder);
…
tree.setXMLAutoLoading("/be3a5/GUI/content/xml/dyntree.xml?country="+parent.actualCountry);
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.attachEvent(“onOpenEnd”,function(){
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?
Thanks,
Marco
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