Optional autoRemember the checked rows (by getRowId). Since 1.1.92 (before: declared without effect).
Optional autoRemember expanded and collapsed nodes of a tree table (by getRowId).
Optional autoRemember width, order and visibility of the columns (by property). Widths are stored only for columns that were
resized, so % and weight columns stay responsive.
1.1.92
Optional autoRemember the data set with TableApi.setCustomState (e.g. a filter text).
1.1.92
Optional autoRemember the expanded detail rows of master/detail (TableOptionsIf.masterDetail, by getRowId).
1.1.97
Optional autoRemember collapsed and expanded header groups (CellGroupIf.toggle).
1.1.92
Optional autoRemember the scroll position (and the id of the first visible row).
Optional autoRemember the selection: rows by getRowId, columns by property. Restored in the current row order. Since 1.1.92 (before: declared without effect).
Remember the sorted columns (by property).
Optional getA unique, stable id per row (tree: per node). With the default of AutoRestoreOptions the table uses the
property id, then uuid; rows without them are not stored (since 1.1.92 – the JSON of the row would write
personal data into the storage; the table warns once).
Optional getThe storage key of this table, e.g. () => "orders". Without it nothing is stored.
Optional issince 1.1.92 – never used; rows are compared by getRowId.
Optional storageWhere the state is stored. Default: localStorage; sessionStorage or an own StateStorageIf also work.
1.1.92
What a table remembers between page loads, and where. Everything is off by default (AutoRestoreOptions); nothing is stored without getStorageKeyFn (the table warns once if a flag is set without it).
The state is stored as one JSON value under
<key>tableStatein storage (defaultlocalStorage) – the same format as TableApi.getState. Columns are stored by property and rows by getRowId, so a moved column or new data never hits the wrong column or row. The stored state holds no cell values, but row ids can be personal data (e.g. an e-mail address as id) – prefer technical ids. The tree, checked rows, the selection and the first visible row need row ids; tree, checked and selected rows are computed only when their flag is set.Before 1.1.92 sorting, scroll position and tree were stored under three keys (
<key>sortingState,<key>scrollState,<key>collapsedExpandedState); they are read once and removed with the next save.Example
Typeparam
T - The type of the rows.
See
Training: Remember the state