JavaScript Data GridPlugin: PersistentState

Description

WARNING

The PersistentState plugin is deprecated and will be removed in version 17.0. Please update your settings to ensure compatibility with future versions.

Save the state of column sorting, column positions and column sizes in local storage to preserve table state between page reloads.

In order to enable data storage mechanism, Options#persistentState option must be set to true.

When persistentState is enabled it exposes 3 hooks:

Note: The main reason behind using persistentState hooks rather than regular LocalStorage API is that it ensures separation of data stored by multiple Handsontable instances. In other words, if you have two (or more) instances of Handsontable on one page, data saved by one instance won't be accessible by the second instance. Those two instances can store data under the same key and no data would be overwritten.

Important: In order for the data separation to work properly, make sure that each instance of Handsontable has a unique id.

Options

persistentState

Source code

persistentState.persistentState : boolean

The persistentState option configures the PersistentState plugin.

You can set the persistentState to one of the following:

Setting Description
false (default) Disable the