save / loadOpenStates in XTree

Hi



We own a professional version of XTree



When tried to use loadOpenStates / saveOpenStates functions which require dhtmlxtree_xw.js to be included - met the following problem.



Tree is created dynamically on the page later on some event.



When loading page we then got an error(FireBug):



dhtmlXTreeObject is not defined dhtmlxtree_xw.js()()



as a result later - next error transformTree.loadOpenStates is not a function



Is there any way out of this?



Thanks.


Hi,


Tree items must be available in order to restore tree open states. So, loadOpenStates should be called after xml loading.


Please, try to use the following approach:





tree.loadXML(“tree.xml”,doAfterLoading);


function doAfterLoading(){


tree.loadOpenStates();


}

Thanks for this.

The point is in a different problem.

We are unable to include …/ext/dhtmlxtree_xw.js file. (without any attempts to call .loadOpenStates())

in firefox firebug gives us the following:
dhtmlXTreeObject is not defined
dhtmlxtree_xw.js()()dhtmlxtree_xw.js (line 9)
[Break on this error] dhtmlXTreeObject.prototype._serEnts=[["&…his._idpull[this.rootId]._userdatalist))


Please, check the order of file including. dhtmlxtree.js should be included before dhtmlxtree_xw.js

Thanks - that helped.