Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by John on Feb 06, 2008 08:58
open dhtmlx forum
saving the trees current state

I am using the Professional version of DHTML tree.

I would like to know how to achieve the following effect: Suppose the user is on a page with a large complicated Tree containing nodes with children. The user selects - opens certain nodes - items in the tree and checks certain 3-way checkbox next to tree items. Then the user leaves the page VIA a HTML FORM submit button. Then the user returns to the page with the tree. I want the user to see the tree in the same state as when a user last left. I want this effect to persist until the user finishes the session. At the completion of the users session the cookie containing the trees last states is deleted.

Please Help,
John
Answer posted by Support on Feb 06, 2008 09:58
The opened state of tree can be saved and restored in|from cookies by
    tree.saveOpenStates(...
    tree.loadOpenStates(...
http://dhtmlx.com/docs/products/dhtmlxTree/samples/initialization_general_settings/pro_cookies.html?un=1202321478000

There is no built in functionality to save checked items ( the API allows to get list of checked elements and setCheck for necessary elements, just miss ready to use saving in cookie )