back to the documentation homepage
jsTree v.1.0
cookies plugin
Description
The cookies
enables jstree to save the state of the tree across sessions. What this does is save the opened and selected nodes in a cookie, and reopen & reselect them the next time the user loads the tree. Depends on the jQuery.cookie plugin.
The nodes need to have IDs for this plugin to work.
Configuration
save_opened
The name of the cookie to save opened nodes in. If set to false
- opened nodes won't be saved.
save_selected
The name of the cookie to save selected nodes in. If set to false
- selected nodes won't be saved.
auto_save
If set to true
jstree will automatically update the cookies every time a change in the state occurs.
cookie_options
The options accepted by the jQuery.cookie plugin.
Demos
Check your data plugin documentation (html_data, xml_data, json_data) or take a close look at these examples for information on how to specify multilanguage nodes.
Using the cookies plugin
Go ahead and make changes to the tree and then refresh this page.
API
.save_cookie ( event )
Save the current state.
-
string
eventUsed internally with the
auto_save
option. Do not set this manually.