Storage
It is possible to save the current user selection so it will be restored after page refresh or once the user travels between different pages. This state can be saved in local storage, session storage, or cookies.
Storage Type
Description
Code Name
Local Storage
Local storage is persistent storage
that keeps data even if the user closes the browser.
It will be cleared only when the user
clears the browser cache.
'local-storage'
Session Storage
Session storage will be cleared when
the browser session is over,
typically when the user closes the browser.
'session-storage'
Cookies
Cookies may have an expiration date,
and also they are passed to the server.
'cookies'

Storage Properties

Property Name
Values
Description
storage
'', 'local-storage', 'session-storage' or 'cookies'
Storage type. The default is an empty value.
name
any text value
If multiple pages have the same storage name,
they will share the same control state.
expiration
Cookie expiration in minutes.
Used for cookies only.
Default value -1 (The cookie expires when the user
closes the browser.)
​
​
​

Local Storage

1
<script>
2
datagrid({
3
storage: 'local-storage',
4
name: 'my-page'
5
});
6
</script>
Copied!

Session Storage

1
<script>
2
datagrid({
3
storage: 'session-storage',
4
name: 'my-page'
5
});
6
</script>
Copied!

Cookies

1
<script>
2
datagrid({
3
storage: 'cookies',
4
name: 'my-page'
5
});
6
</script>
Copied!
Copy link
Contents