Adaptable Events Reference

View as Markdown

Summary

  • AdapTable publishes a number of Events throughout the application lifecycle
  • 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 lifecycle 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 argument is the matching *Info object, for example LayoutChangedInfo. AdaptableDestroy has no payload.

Base Context

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

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 unsubscription 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 DestroyAdapTable has been destroyed and should no longer be used
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
Before Adaptable State ChangeSomething is about to change in AdapTable State
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
Column Filter ChangedA Column Filter changed (including editor drafts not yet 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'
Note ChangedA Note has been added, edited or deleted
Report Schedule RanA Report Schedule has run
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
System Status Message DisplayedA new System Status Message has been displayed
Team Sharing Entity ChangedAn Active Shared Entity in Team Sharing has changed
Theme SelectedA Theme has been selected

Event API

The EventApi section of Adaptable API subscribes to and publishes Adaptable Events:

EventApi

Subscribe to AdapTable events.

on registers a listener and returns a function that removes it. off removes a listener that was passed to on for the same event. The callback argument is the info object for that event.

Unsubscribe from GridSorted

Unsubscribe from RowSelectionChanged

Unsubscribe from ThemeSelected

Unsubscribe from SystemStatusMessageDisplayed

Unsubscribe from AlertFired

Unsubscribe from DataImported

Unsubscribe from FlashingCellDisplayed

Unsubscribe from LayoutChanged

Unsubscribe from CalculatedColumnChanged

Unsubscribe from CustomToolbarConfigured

Unsubscribe from GridFilterApplied

Unsubscribe from DashboardChanged

Unsubscribe from BeforeAdaptableStateChange

Unsubscribe from AdaptableStateChanged

Unsubscribe from AdaptableStateReloaded

Unsubscribe from LiveDataChanged

Unsubscribe from RowFormSubmitted

Unsubscribe from DataSetSelected

Unsubscribe from ChartChanged

Unsubscribe from CommentChanged

Unsubscribe from NoteChanged

Unsubscribe from ReportScheduleRan

Unsubscribe from AdaptableDestroy

Unsubscribe from AdaptableReady

Unsubscribe from Fdc3Message

Unsubscribe from ColumnFilterChanged

Unsubscribe from ColumnFilterApplied

Unsubscribe from CellChanged

Unsubscribe from RowChanged

Unsubscribe from TeamSharingEntityChanged

Unsubscribe from CellSelectionChanged

on(eventName, callback)
returns

VoidFunction

Event fired whenever AdapTable is Sorted

on(eventName, callback)
returns

VoidFunction

Event fired whenever the Row Selection in AdapTable changes.

on(eventName, callback)
returns

VoidFunction

Event fired whenever a shipped theme (light, dark, or os) is selected or re-applied

on(eventName, callback)
returns

VoidFunction

Event fired whenever a System Status Message is displayed in AdapTable

on(eventName, callback)
returns

VoidFunction

Event fired whenever an Alert is triggered in AdapTable.

on(eventName, callback)
returns

VoidFunction

Event fired when Data has been imported

on(eventName, callback)
returns

VoidFunction

Event fired whenever Cell Flashing is triggered in AdapTable.

on(eventName, callback)
returns

VoidFunction

Event fired whenever the current Layout updates in AdapTable

on(eventName, callback)
returns

VoidFunction

Event fired whenever a Calculated Columns is created / updated / deleted in AdapTable

on(eventName, callback)
returns

VoidFunction

Event fired whenever Configure Button is clicked in a Custom Toolbar

on(eventName, callback)
returns

VoidFunction

Event fired whenever a Grid Filter is applied in AdapTable

on(eventName, callback)
returns

VoidFunction

Event fired whenever Dashboard State changes
Primarily used for rendering Custom toolbars.

on(eventName, callback)
returns

() => void

Event fired before Adaptable State changes (before the action is processed)

on(eventName, callback)
returns

() => void

Event fired whenever Adaptable State changes

on(eventName, callback)
returns

() => void

Event fired whenever Adaptable State is reloaded

on(eventName, callback)
returns

() => void

Event fired whenever a change occurs relating to live reports / data
Used in conjunction with AdapTable's partners OpenFin or ipushpull

on(eventName, callback)
returns

() => void

Event fired when a Row Form is submitted

on(eventName, callback)
returns

() => void

Event fired when a DataSet is Selected

on(eventName, callback)
returns

() => void

Event fired when a Chart is Changed

on(eventName, callback)
returns

() => void

Event fired when a Comment is Changed

on(eventName, callback)
returns

VoidFunction

Event fired whenever a Note is added, edited or deleted in AdapTable

on(eventName, callback)
returns

VoidFunction

Event fired whenever a Schedule is triggered in AdapTable

on(eventName, callback)
returns

VoidFunction

Fired when Adaptable is up and running - has no arguments.

on(eventName, callback)
returns

VoidFunction

Fired when Adaptable is destroyed

on(eventName, callback)
returns

() => void

Event fired when an FDC3 message is sent(Raise Intent or Broadcast Context) or received (Intent or Context)

on(eventName, callback)
returns

VoidFunction

Event fired whenever a Column Filter changes in AdapTable — including
incomplete editor drafts that are not yet applied.

on(eventName, callback)
returns

VoidFunction

Event fired whenever a Column Filter is Applied in AdapTable (persisted;
grid filtering may run). Prefer ColumnFilterChanged + isApplied for new code.

on(eventName, callback)
returns

VoidFunction

Event fired whenever a cell changes in the Grid

on(eventName, callback)
returns

VoidFunction

Event fired when a row is added, deleted or updated in the Grid

on(eventName, callback)
returns

VoidFunction

Event fired whenever a Shared Entity in Team Sharing changes

on(eventName, callback)
returns

VoidFunction

Event fired whenever the Cell Selection in AdapTable changes.