Getting Started Technical Reference

View as Markdown

Adaptable Ready Event

The Adaptable Ready Event provides an AdaptableReadyInfo object with 2 key properties:

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.

AG Grid GridApi for this grid.

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

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