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.

storageName

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

<script>
    datagrid({
        storage: 'local-storage',
        storageName: 'my-page'
    });
</script>

Session Storage

<script>
    datagrid({
        storage: 'session-storage',
        storageName: 'my-page'
    });
</script>

Cookies

<script>
    datagrid({
        storage: 'cookies',
        storageName: 'my-page'
    });
</script>

Last updated