Partial state restore and slice selection
Allows getState and setState to target specific slices (for example only columns and sort) and to merge into the current state or replace it. Partial restore supports scenarios such as 'apply this layout but keep my current filters'.
Planned. This page shows the specification from issue #201. The live example, source for every framework and the API reference replace it when the feature ships.
Live example
A grid with an existing filter and a selection, plus a saved 'Compact layout' state.
Expected behavior
With only Columns checked and merge mode, applying the layout changes widths and order while filters and selection remain. In replace mode with Columns checked, unchecked slices are reset to their defaults.
Planned API surface
getState({include, exclude})setState(state, {include, exclude, mode:'merge'|'replace'})StateSlice enumAcceptance criteria
- include and exclude accept slice names and are mutually exclusive. (pending)
- Merge mode leaves slices that are not included untouched. (pending)
- Replace mode resets slices that are not included to their initialState values. (pending)
- Within a slice, merging is shallow by default. Column entries merge by column id. (pending)
- Restoring a partial state emits change events only for the slices that changed. (pending)