Managing AdapTable State at Run-Time
Summary
- The primary place to manage State at run-time is in AdapTable DevTools
- Additionally, the State Management Module inside AdapTable contains much of the same functionality
AdapTable State usually just 'happens' without the User being aware of the persistence mechanism or needing to do anything in particular.
But sometimes State doesn't behave the way you expect, or you might need to manage it in other ways.
Accordingly, AdapTable provides 2 resources to enable AdapTable State to be managed at run-time:
- AdapTable DevTools in Chrome - has a comprehensive State Management section
- State Management Module - available in the Settings Panel (hidden by default)
AdapTable DevTools
AdapTable DevTools records snapshots of Adaptable State as the Grid runs — tag, restore, compare, upload/download JSON, and migrate — without entitling the in-app module.
Find Out More
Install and pick an instance on AdapTable DevTools. Handbook walkthrough — DevTools — Manage State. Inspect versions and layout first — DevTools — Grid Info.
State Management Module
The Statement Management Module also allows run-time users to import and export AdapTable State.
Its functionality can be accessed in 3 UI components:
- The
Manage Statesection in the Settings Panel - The
Manage StateToolbar in the Dashboard - The
Manage StateTool Panel in the AdapTable Tool Panel Component
Important
- Due to its more "support-like" nature, the State Management Module is
Hiddenby default - To make it available, set its Entitlement to
Full(orReadOnly) for those users who need it:
entitlementOptions: {
moduleEntitlements: [{ adaptableModule: 'StateManagement', accessLevel: 'Full' }],
},- Setting
defaultAccessLeveltoFulldoesn't unhide the Module; it must be entitled explicitly inmoduleEntitlements
Module Functionality
All 3 Manage State components contain 4 State-related options:
- Clearing User State
- Loading Initial Adaptable State (from a JSON file)
- Exporting the AdapTable State - to Clipboard, Console or JSON
- Exporting Initial Adaptable State - to Clipboard, Console or JSON
Caution
Clearing User State will re-load the initial Initial Adaptable State that was provided
Note
- If using Local Storage, AdapTable will automatically clear what is in the User's State
- If using Remote Storage, AdapTable will invoke the
clearStatefunction that was provided at design-time
- This demo opens the State Management page of the Settings Panel
Reloading Initial State
The Manage State panel allows you to re-apply your Initial Adaptable State using a JSON file.
This is done using the Load Initial Adaptable State button.
When clicked, AdapTable will replace the current State with the State in the uploaded file.
- The demo illustrates how to reload the Initial Adaptable State using the
Manage StateSettings Panel - Initial State includes a Format Column on
Name(blue). Change Format Columns replaces it with runtime styles onGithub StarsandLanguage; reloading from the downloadable file restoresName
- On load, confirm
Nameis styled blue (from Initial State) - Click Change Format Columns —
Namestyling is removed andGithub Stars(yellow) /Language(green) appear instead - Download this file: initial-adaptable-state.json
- Open the Settings Panel using the Manage State module button, and then click Load Initial Adaptable State to select the downloaded file
- Runtime styles disappear and
Name(blue) returns — confirming the Grid was restored from the file