Getting Started Technical Reference
Adaptable Ready Event
The Adaptable Ready Event provides an AdaptableReadyInfo object with 2 key properties:
adaptableApi— the Adaptable API (fromBase Context)agGridApi— AG Grid's Grid API, returned on this object and also available asadaptableApi.agGridApi
AdaptableReadyInfo
Payload of the AdaptableReady event.
Fires once, when AdapTable has loaded. A listener added after that still runs, because this event replays for late subscribers.
Extends . Use adaptableApi for AdapTable and agGridApi for AG Grid.
BaseContext
Base class for all AdapTable callbacks and Events
Adaptable Api object
Custom application Context provided in AdaptableOptions.adaptableContext
string
Id of current AdapTable instance
string
Current Adaptable State Key
Date
Time on user's computer
string
Name of Current User
Custom application Context provided in AdaptableOptions.adaptableContext
Subscribing to the Event
Vanilla Adaptable.init already returns adaptableApi. Subscribe with eventApi.on for setup that must wait until the Grid is ready.
Note
If you subscribe after init has resolved, you still receive the Event
const adaptableApi = await Adaptable.init(adaptableOptions, agGridConfig);
adaptableApi.eventApi.on(
'AdaptableReady',
({adaptableApi, agGridApi}: AdaptableReadyInfo) => {
adaptableApi.quickSearchApi.runQuickSearch('react');
agGridApi.autoSizeAllColumns();
}
);Once you have adaptableApi, later Adaptable Events are subscribed in the usual way: adaptableApi.eventApi.on(...).
Find Out More
- See Adaptable Ready Event for a worked example
- The full first-run wiring is on Integrating AdapTable
AG Grid API
agGridApi is AG Grid's Grid API (of type AgGridApi).
AdapTable does not declare methods of its own on this type.
The Adaptable Ready Event returns it on the AdaptableReadyInfo object, next to adaptableApi.
The subscription examples above read it from that payload:
({agGridApi}: AdaptableReadyInfo) => {
agGridApi.autoSizeAllColumns();
};The same Grid API object is a property on the base of the Adaptable API.
Any code that already holds adaptableApi reaches it there:
adaptableApi.agGridApi.autoSizeAllColumns();Caution
- Always prefer the API methods provided by AdapTable where one exists
- That keeps AG Grid, AdapTable, and AdapTable State in sync
Find Out More
See Configuring AG Grid for how GridOptions and columns are set up