Adaptable

#<adaptable-provider> inputs

The heart of an Adaptable instance: identifies it, holds its state and wires up data, modules, events and persistence. Renders no UI itself — put <adaptable-workspace>, <adaptable-ui> or your own composition inside, in the same template. It is the standalone component AdaptableProvider: list it in the imports of your component.

<adaptable-provider adaptableId="app" primaryKey="id" [data]="data" [defaultState]="state">
  <adaptable-workspace />
</adaptable-provider>
Inputs, model and outputs in Angular

<adaptable-provider> takes the props below as inputs of the same names ([data], [defaultState], primaryKey="id", [events], [userInfo], …), except:

  • state is a model: [(state)]="state" is the controlled form (React's state + onStateChange). Its output (stateChange) reports every change of the state, controlled or not. As everywhere in Angular, the controlled state is not strictly controlled: a change the grid makes is applied even when you do not bind it back.
  • onReady is the output (ready); it emits the { adaptableApi } context.
  • onStateChange stays an input too, for a callback that wants both arguments (state, prevState), as do the other callbacks whose arguments or return value matter (persistState, loadState, onStateChangeWithSelectors, …).
  • children is the content of the element.

adaptableId and the choice between state and defaultState are read when the provider is initialized: to start a new instance, give the element a new identity (@for (…; track id)).

Reading the types in Angular

Where a type says Renderable, Angular takes text, a TemplateRef, what renderTemplate(template, context) and renderComponent(Component, { inputs }) return, or an array of those; ComponentType, FunctionComponent and ComponentOverride are a component class or a TemplateRef (its context holds the props); an inline style is an object of CSS properties in camelCase, where numbers are pixels.

24 props

#adaptableIdrequiredstring

Unique id for this Adaptable instance. Used to identify the instance and to namespace persisted state.

#applyState(context: ApplyStateContext) => JSON

Full control over applying a loaded state to the instance.

#authRolesRecord<string, AdaptablePermission[]>

Maps role names to permission lists — controls what the current user (see userInfo) is allowed to do.

#childrenRenderable

The children of the Adaptable component. Typically <Adaptable.Workspace> or <Adaptable.UI>.

#componentsAdaptableUIComponents<DATA_TYPE>

Overrides for the UI building blocks: custom InfiniteTable / DataSource / AdaptablePopupPortal components, plus any Infinite Table component overrides.

#dataAdaptableData<DATA_TYPE>

The data for the grid: an array, a promise, or a (data-params) function.

Optional when an Adaptable.DataSource wraps the Provider — the component's data is used then. When both are present, this prop wins.

#dataSourceAdaptableDataSourceConfig

Instance-level data-loading behavior (mode / batchSize / refetchOn) when passing data via the data prop. Prefer the Adaptable.DataSource component, which carries the same config alongside its data. Per-view overrides go through view.dataSource / viewDefaults.dataSource.

#defaultStateAdaptableUserState

The initial (uncontrolled) user state for the instance. For the controlled version, use state — pass exactly one of the two.

#eventsAdaptableEventsProp<DATA_TYPE>

Event callbacks: onAlertTrigger (an alert fired), onDataChanges (data edits), onCellDoubleClick (a cell was double-clicked; return { preventEdit: true } to skip edit mode), onCellNoteChange, onCellNoteMention and onReady.

#filterValuesFilterValuesFn

Loads the pickable values for single/multi value column filters. Prefer the Adaptable.DataSource component's filterValues; this prop wins when both are present. Defaults to data.filterValues when the data function carries one (createTdgpDataSource does).

#licenseKeystring

Your Adaptable license key.

#loadState(context: LoadStateContext) => Promise<any | null>

Loads the state from the (remote) storage.

#modulesAdaptableModule[] | XOR<{ include: ModuleIdsType[] }, { exclude: ModuleIdsType[] }>

Modules available for this Adaptable instance.

  • Pass an array of module objects from @adaptabletools/datagrid-react/modules (instance-scoped registration; omit to use the full catalog).
  • Or filter the default catalog with { include } / { exclude } (legacy).

#onReady(eventInfo: AdaptableReadyContext<DATA_TYPE>) => void

Called once the Adaptable instance is ready.

#onStateChange( state: AdaptableUserState, prevState: AdaptableUserState, ) => void

Called whenever the user state changes.

#onStateChangeWithSelectorsAdaptableStateChangeListener<any>[]

Fine-grained state listeners: each entry has a selector, a callback invoked when the selected slice changes, and an optional equals.

#parseState(context: ParseStateContext) => Promise<JSONPatch>

Gives you the ability to deserialize/parse the state once it was loaded from the (remote) storage.

By default, if this prop is not provided, the state is deserialized using JSON.parse (as it assumed it was serialized with JSON.stringify)

For the opposite operation, see AdaptableProps.serializeState

#persistState(context: PersistStateContext) => Promise<void>

Sends the serialized state to the (remote) storage.

For the inverse operation, see AdaptableProps.loadState

#portalContainerHTMLElement | (() => HTMLElement | null | undefined)

The element popups are rendered into: column and context menus, selects, comboboxes, popovers, tooltips and dialogs.

Defaults to an element appended to document.body. A function is called again whenever the instance re-renders; returning null uses the default.

Column and context menus are kept within the Adaptable.Workspace (or the grid, when there is no workspace) wherever they are rendered.

#primaryKeyrequiredstring

The primary key for the data in Adaptable.

This is the name of the property that should be found in all data rows. The value of this property needs to uniquely identify each row.

#serializeState(context: SerializeStateContext) => Promise<any>

Gives you the ability to serialize the state before it is persisted.

By default, if this prop is not provided, the state is serialized to a JSON string

For the opposite operation, see AdaptableProps.parseState

#stateAdaptableUserState

The controlled user state for the instance. For the uncontrolled version, use defaultState — pass exactly one of the two.

#stateKeystring

The storage key used when persisting and loading state — passed to persistState, loadState and applyState.

#userInfoUserInformation | ((context: UserInformationContext) => UserInformation)

Information about the current user — either an object or a function that returns it. Used together with authRoles to control permissions.