Adaptable Events Reference

Summary

  • AdapTable publishes a number of Events throughout the application lifecyle
  • These events provide rich information about everything that is happening inside AdapTable and AG Grid
  • Some events reflect user actions, others react to changes in the grid or its data
  • Two particularly important events are:
    • AdaptableReady fires when AdapTable is initialised and the State is loaded enabling post setup actions
    • AdaptableStateChanged fires whenever anything changes in AdapTable State

Understanding Adaptable Events

AdapTable fires many Events throughout the application's lifecyle to which developers can subscribe.

Most AdapTable Events react to one of 2 types of action:

  • An AdapTable Module or functionality doing something

    Examples include LayoutChanged, SystemStatusMessageDisplayed, AlertFired, DashboardChanged etc.

  • Something happening in AG Grid

    Examples include CellChanged, CellSelectionChanged, RowChanged etc.

Subscribing to Events

Subscription to Adaptable Events is done via the on method in the Event section of the Adaptable API.

This takes 2 parameters:

  • eventName - name of the Adaptable Event being subscribed to

  • callback - object containing relevant information to the Adaptable Event and why it fired

    Note

    The callback object is always of type [EventName]Info - e.g. LayoutChangedInfo

Base Context

Every EventInfo object inherits from the BaseContext object which has these properties:

PropertyDescription
adaptableApiAdaptable Api object
adaptableContextCustom application Context provided in AdaptableOptions.adaptableContext
adaptableIdId of current AdapTable instance
adaptableStateKeyCurrent Adaptable State Key
clientTimestampTime on user's computer
userNameName of Current User

For example the definition of the LayoutChangedEvent is:

on(
    eventName: 'LayoutChanged',
    callback: (eventInfo: LayoutChangedInfo) => void
): () => void;

So to subscribe to the event you can do something like:

adaptableApi.eventApi.on('LayoutChanged', (eventInfo: LayoutChangedInfo) => {
    // do something with the info
});

Unsubscribing from Events

For every Adaptable Event there is a parallel unsubsciption off method.

This takes the same form as the on method, so unsubscribing from the LayoutChangedEvent is simply:

off(
    eventName: 'LayoutChanged',
    callback: (eventInfo: LayoutChangedInfo) => void
): () => void;

List of Adaptable Events

Adaptable EventWhen Fired
Adaptable ReadyAdapTable has finished initialising and the Store is up and running
Adaptable State ChangedSomething has changed in AdapTable State
Adaptable State ReloadedAdapTable State has been reloaded
Alert FiredAn Alert has been Fired in AdapTable
Calculated Column ChangedA Calculated Column has been added, edited or deleted
Cell ChangedUser makes an edit in a Grid Cell or a ticking data change is made
Cell Selection ChangedCells have been selected in AG Grid
Chart ChangedA Chart has been displayed
Column Filter AppliedColumn Filters have been applied
Comment ChangedComments have been updated
Custom Toolbar ConfiguredThe 'configure' button is clicked in a Custom Toolbar
Dashboard ChangedSomething has changed in the Dashboard
Data ImportedThe Data Import wizard has finished
DataSet SelectedA new DataSet has been selected
FDC3 MessageAn FDC3 Message has been sent or received
Flashing Cell DisplayedA Flashing Cell has flashed
Grid Filter AppliedA Grid Filter has been applied
Grid SortedA Column in AdapTable has been sorted
Layout ChangedA Layout has changed or been selected
Live Data ChangedSomething happens related to the AdapTable 'live reports'
Row ChangedRows have been added, updated or deleted in AG Grid
Row Form SubmittedA Row Form has been submitted (or Delete button clicked)
Row Selection ChangedRows have been selected in AG Grid
Schedule TriggeredA Reminder or a Report Schedule has been triggered
System Status Message DisplayedA new System Status Message has been displayed
Team Sharing Entity ChangedAn Active Shared Entity in Team Sharing has changed
Theme ChangedA Theme has been selected or edited

Event API

The EventAPI section of Adaptable API is used to publish Adaptable Events