Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by max on Feb 13, 2009 02:21
open dhtmlx forum
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.
Answer posted by Alex (support) on Feb 13, 2009 05:43

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();

}

 

Answer posted by Max on Feb 13, 2009 06:51
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))

Answer posted by Alex (support) on Feb 13, 2009 07:13

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

Answer posted by Max on Feb 13, 2009 09:36
Thanks - that helped.