Where AutoRestoreOptionsIf stores the state of a table (AutoRestoreOptionsIf.storage). A synchronous
key-value store with the method names of the Web Storage API – localStorage (default) and sessionStorage
fit directly.
The table reads the state while it is built, so the storage must answer synchronously. To keep the state on a
server, load it before you create the table and pass it as TableOptionsIf.initialState; save it in
EventListenerIf.onStateChanged.
Example
consttableOptions: TableOptionsIf = { ...newTableOptions(), autoRestoreOptions: { ...newAutoRestoreOptions<Order>(), getStorageKeyFn: () =>"orders", storage:sessionStorage, // forget the layout when the tab is closed autoRestoreColumnLayout:true } };
Example
// an own storage, e.g. a prefix for all keys constprefixed: StateStorageIf = { getItem:key=>localStorage.getItem("my-app/" + key), setItem: (key, value) =>localStorage.setItem("my-app/" + key, value), removeItem:key=>localStorage.removeItem("my-app/" + key) };
Where AutoRestoreOptionsIf stores the state of a table (AutoRestoreOptionsIf.storage). A synchronous key-value store with the method names of the Web Storage API –
localStorage(default) andsessionStoragefit directly.The table reads the state while it is built, so the storage must answer synchronously. To keep the state on a server, load it before you create the table and pass it as TableOptionsIf.initialState; save it in EventListenerIf.onStateChanged.
Example
Example
Since
1.1.92