## Persist State

This sample shows how you can persist the grid state using cookies.

To see how this works, change the selection and sort any column in any direction, then leave the page. When you return to this page, the original state will be automatically restored.

As an alternative to cookies, you could persist the state using the localStorage or sessionStorage objects available in HTML5 browsers.

Note that the data shown is generated randomly, and is not persisted. So the selection and sorting will be restored, but not the data itself.