AdapTable State Guide
Summary
- AdapTable State is the UI configuration for an instance: Layouts, searches, styles, and the other Module objects
- Developers ship Initial Adaptable State at design-time (a
Layoutsection is required) - Coding agents can also be used to manage State - in 2 ways:
- adaptable-dev for day-to-day State work
- adaptable-upgrade - when upgrading between AdapTable versions
- First load merges that into User State; later loads restore the persisted User State
- Persistence is automatic (localStorage by default); most production apps use remote
loadState/persistState - Some sections are transient and are never persisted
- Support and developers inspect live State in AdapTable DevTools (Manage State or the In-page API)
Important
- AdapTable State does not include AG Grid data; it deals only with the AdapTable UI and associated objects
- Likewise AdapTable does not have access to the clients' private data
AdapTable State is how an instance remembers its configuration between sessions.
Developers populate Initial Adaptable State at design-time. Users then add, edit and delete objects at run-time.
Note
Entitlements, options and other design-time settings that users cannot change live in Adaptable Options, not in State
Those changes are persisted and re-applied on the next start.
Find Out More
- For Agent Skills install and commands see Agent Skills
- For tickets on a live Grid see Supporting AdapTable
Using Agent Skills
adaptable-dev Agent Skill
Install Agent Skills, then run the adaptable-dev skill to add or change Initial Adaptable State — Layouts, Filters, Format and Styled Columns, Alerts and the other persistable objects.
The agent designs from the docs for your installed version, then validates with `check state` and `check expression` through the adaptable CLI.
adaptable-upgrade Agent Skill
Run the adaptable-upgrade skill to plan a move to a newer AdapTable major, migrate Initial State and user State, and pair the required AG Grid upgrade.
Rehearse with the State Migration Tool or DevTools — Manage State Migrate tab, then run `check state` on the migrated JSON before you ship.
How AdapTable State Works
At design-time developers create Initial Adaptable State.
This is a JSON object that contains the items the AdapTable instance requires for first use.
It consists of multiple sections — each relating to one Module in AdapTable.
Other sections are optional - with the exception of Layout which is required and must contain at least one Layout (unless Default Layouts are configured).
Some of the contents of each section are collections of Adaptable Objects (e.g. Layouts) but can also be string properties (e.g. name of the Current Layout).
When the application loads for the first time, the Initial Adaptable State is read into memory.
This Initial State is then stored as AdapTable State and is updated (and automatically persisted) with any user state that is created during that session.
It can be stored locally or remotely depending on your settings.
Each later launch retrieves that persisted User State and pre-populates the AdapTable instance with it.
Users see the same configuration they had on their previous visit.
Hint
The Revision property lets you update a section of Initial State after go-live without wiping the rest of User State
What is Persisted
Most of AdapTable State is persisted. That persisted object is the Initial State sections plus Team Sharing (Team Sharing is run-time only — it is not part of Initial State).
These sections are transient: they exist in the in-memory store but are never written by persistState:
InternalPopupCommentPlugins
Default AdapTable State
AdapTable State is almost entirely empty when the Application starts for the first time.
It is then populated by the supplied Initial Adaptable State.
A few defaults are provided for convenience:
Note
All of these can be replaced by properties in Initial Adaptable State if necessary
| Module | Default Property Description |
|---|---|
| Dashboard | ModuleButtons is an empty list |
| Quick Search | Default highlight style (black text on yellow) |
| Theme | Current Theme is set to light |
| Tool Panel | A SettingsPanel Button is provided in the ModuleButtons property |
Redux
Internally AdapTable uses Redux to manage its state.
This provides a uni-directional store for all the objects used in the grid.
Caution
If using Redux in your application, continue to maintain your own Store; merging the 2 Stores can cause complications
Pages in this Section
The pages follow the State lifecycle:
- Provide Initial State
- Persist User State
- Update Initial State after go-live
- Customise, suspend and listen
- Manage in the UI, migrate between versions, then the API
| Page | Summary |
|---|---|
| Providing Initial Adaptable State | Design-time objects for first use — Layout is required |
| AdapTable State Persistence Guide | localStorage by default, or your own loadState / persistState |
| Updating Initial AdapTable State | Ship section Revisions after go-live without wiping User State |
| Custom AdapTable State | Store your own key / value pairs in the Application section |
| Suspending Adaptable Objects | Turn objects off with IsSuspended without deleting them |
| Listening to AdapTable State | AdaptableStateChanged, BeforeAdaptableStateChange and reload |
| Managing AdapTable State at Run-Time | Import, export and clear State in the Settings Panel (hidden by default) |
| Migrating Adaptable State | Automatic migration on load, or migrateAdaptableState by hand |
| State Migration Tool | Paste State for one major version and migrate it to another |
| Adaptable State Technical Reference | State Options, State API and Event Info |
FAQ
Where is AdapTable State stored?
By default it is stored in the browser's local storage, under adaptableStateKey (which defaults to adaptableId if you omit it). Use the State Options functions to save State in any location you specify (and to enrich it en route).
Do you provide data adapters to fetch / save AdapTable State? No we don't, you will need to provide the mechanism to store your State in a remote location. There are simply too many different storage locations and mechanisms for us to provide connectors.
Does AdapTable persist everything in the Redux store?
No. Internal, Popup, Comment and Plugins are transient and never written by persistState.
Can a coding agent author or migrate State?
Use adaptable-dev for day-to-day initialState work and adaptable-upgrade for major upgrades; both rely on `check state`. For a live Grid on a ticket, use adaptable-debug.