New to Kendo UI for jQuery? Download free 30-day trial
jQuery TreeList Persist State
- EXAMPLE
- VIEW SOURCE
-
Change Theme
defaultDefault Theme
- Main
- Main Dark
- Nordic
- Ocean Blue
- Ocean Blue A11Y
- Purple
- Turquoise
Bootstrap Theme- Main
- Bootstrap 3
- Bootstrap 3 Dark
- Main Dark
- Nordic
- Turquoise
- Turquoise Dark
- Urban
- Vintage
Material Theme- Main
- Arctic
- Lime Dark
- Main Dark
- Nova
Classic Theme- Main
- Green
- Green Dark
- Lavender
- Lavender Dark
- Main Dark
- Metro
- Metro Dark
- Moonlight
- Opal
- Opal Dark
- Silver
- Silver Dark
- Uniform
Fluent Theme- Main
Also available for:
API REFERENCEDescription
The Kendo UI for jQuery TreeList component supports the ability to store settings and restore them later.
The Kendo UI for jQuery TreeList enables you to store the custom settings of the user and restore them when the user logs back in at some future moment. This feature is known as state persistence and is availabe through the getOptions
and the setOptions
methods.
The current example shows how to save the TreeList setting in the localStorage
and restore them on button clicks.
This TreeList example is part of a unique collection of hundreds of jQuery demos, with which you can see all Kendo UI for jQuery components and their features in action. View the source code of the demos from the library or directly adapt, and edit them and their theme appearance in Kendo UI for jQuery Dojo or ThemeBuilder.
Description
A common scenario is to save the user's preferences and settings when interacting with your application. These preferences should be restored once the user logs back in at any point in the future.
Kendo UI TreeList enables you to save the applied user preferences by using the getOptions method and then restore them using the setOptions method. These methods allow you to serialize TreeList's current state when needed and recover it later on.
In this particular example, we use the localStorage of the browser to save and load the TreeList widget's settings.
Further information on the setOptions and getOptions methods is available in the TreeList API section.