Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by anil on Jun 26, 2008 00:27
open dhtmlx forum
How to set cookie for dhtmlxTree

hi,
i m using dhtmlxTree for my tree menu. its working well.
but i want save states of last open nodes in cookie. so when any open page it will so last open nodes.

i read and get dhtmlXTree_xw.js file but i dont have idea how to call this function and make it working.
plz help me.
Answer posted by Support on Jun 26, 2008 02:26
To save state in cookies
    tree.saveOpenStates();
To load state
    tree.loadOpenStates()

You code will be similar to next
    tree = new ..
    ...
    tree.loadXML(url,function(){
        tree.loadOpenStates()
    });
    dhtmlxEvent(window,"unload",function(){
        tree.saveOpenStates()
    });
Answer posted by anil on Jun 26, 2008 04:47

hi,

I diidn'd get what u say. can u plz tell me in details or send me any working example or reference for my problem. I m not load menu from XML. i m using simple HTML base tree. i m attached here my example in .rar file.

MY PROBLEM IS:

i m using dhtmlxTree for my tree menu. its working well.
but i want save states of last open nodes in cookie. so when any open page it will so last open nodes.

i read and get dhtmlXTree_xw.js file but i dont have idea how to call this function and make it working.

 

Attachments (1)
Answer posted by Support on Jun 26, 2008 05:07
The same commands will work for HTML base tree as well, just need to execute them in correct moment of time.
Please check attached sample.
Attachments (1)
sample.zip1.14 Kb