Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by PB on Jan 23, 2008 14:29
open dhtmlx forum
Saving and Loading Tree States

I have tried to save and load the tree state using this example code from another answer on the subject...

In you code saveOpenStates will rewrite previously saved state, you can use next code

oClientDirectory=new dhtmlXTreeObject('ClientDirectory',"100%","100%",0);
oClientDirectory.loadXMLString('<?xml version="1.0" encoding="iso-8859-1" ?><tree id="0">.........');
oClientDirectory.loadOpenStates();
oClientDirectory.attachEvent("onOpenEnd",function(){
oClientDirectory.saveOpenStates();
});

In such case saved state will be correctly restored on loading, and saved in cookie after any open|closing operation.
( alternatively you can attach saving command to unload event of window )

However, I am getting javascript errors 'saveOpenStates()' and 'loadOpenStates()' are not functions, everything else is working great.
Answer posted by Support on Jan 24, 2008 01:53
Both methods stored in dhtmlxtree_xw.js , which need to be included in your page.