📔
DataGrid Documentation
  • Getting Started
  • Buy DataGrid on CodeCanyon
  • Controls
    • Text Filter
    • Sort DropDown Control
    • Sort Button Control
    • Checkbox Filter
    • Radio Button Filter
    • Select Filter
    • Button Filter
    • Pagination
    • Page Size Control
    • Label Control
    • Reset Button
  • Multiple version of the same control (data-id attribute)
  • Languages Support
  • Special Classes
  • Deep Links
  • Storage
  • Multiple DataGrids on Page
  • Filter AND/OR Logic [NEW]
  • How To
    • How To Sort Table in JavaScript
    • HTML Table with Sortable Headers
    • How to Filter HTML Table By Multiple Columns
    • Double Sort (Multiple Column Ordering)
Powered by GitBook
On this page

Was this helpful?

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>
PreviousDeep LinksNextMultiple DataGrids on Page

Last updated 1 year ago

Was this helpful?