Adaptable Events Reference
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:
AdaptableReadyfires when AdapTable is initialised and the State is loaded enabling post setup actionsAdaptableStateChangedfires 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,DashboardChangedetc. -
Something happening in AG Grid
Examples include
CellChanged,CellSelectionChanged,RowChangedetc.
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 tocallback- 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:
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
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 Event | When Fired |
|---|---|
Adaptable Destroy | AdapTable has been destroyed and should no longer be used |
| Adaptable Ready | AdapTable has finished initialising and the Store is up and running |
| Adaptable State Changed | Something has changed in AdapTable State |
| Adaptable State Reloaded | AdapTable State has been reloaded |
| Alert Fired | An Alert has been Fired in AdapTable |
| Before Adaptable State Change | Something is about to change in AdapTable State |
| Calculated Column Changed | A Calculated Column has been added, edited or deleted |
| Cell Changed | User makes an edit in a Grid Cell or a ticking data change is made |
| Cell Selection Changed | Cells have been selected in AG Grid |
| Chart Changed | A Chart has been displayed |
| Column Filter Applied | Column Filters have been applied |
| Column Filter Changed | A Column Filter changed (including editor drafts not yet applied) |
| Comment Changed | Comments have been updated |
| Custom Toolbar Configured | The 'configure' button is clicked in a Custom Toolbar |
| Dashboard Changed | Something has changed in the Dashboard |
| Data Imported | The Data Import wizard has finished |
| DataSet Selected | A new DataSet has been selected |
| FDC3 Message | An FDC3 Message has been sent or received |
| Flashing Cell Displayed | A Flashing Cell has flashed |
| Grid Filter Applied | A Grid Filter has been applied |
| Grid Sorted | A Column in AdapTable has been sorted |
| Layout Changed | A Layout has changed or been selected |
| Live Data Changed | Something happens related to the AdapTable 'live reports' |
| Note Changed | A Note has been added, edited or deleted |
| Report Schedule Ran | A Report Schedule has run |
| Row Changed | Rows have been added, updated or deleted in AG Grid |
| Row Form Submitted | A Row Form has been submitted (or Delete button clicked) |
| Row Selection Changed | Rows have been selected in AG Grid |
| System Status Message Displayed | A new System Status Message has been displayed |
| Team Sharing Entity Changed | An Active Shared Entity in Team Sharing has changed |
| Theme Selected | A 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.
void
Unsubscribe from GridSorted
void
Unsubscribe from RowSelectionChanged
void
Unsubscribe from ThemeSelected
void
Unsubscribe from SystemStatusMessageDisplayed
void
Unsubscribe from AlertFired
void
Unsubscribe from DataImported
void
Unsubscribe from FlashingCellDisplayed
void
Unsubscribe from LayoutChanged
void
Unsubscribe from CalculatedColumnChanged
void
Unsubscribe from CustomToolbarConfigured
void
Unsubscribe from GridFilterApplied
void
Unsubscribe from DashboardChanged
void
Unsubscribe from BeforeAdaptableStateChange
void
Unsubscribe from AdaptableStateChanged
void
Unsubscribe from AdaptableStateReloaded
void
Unsubscribe from LiveDataChanged
void
Unsubscribe from RowFormSubmitted
void
Unsubscribe from DataSetSelected
void
Unsubscribe from ChartChanged
void
Unsubscribe from CommentChanged
void
Unsubscribe from NoteChanged
void
Unsubscribe from ReportScheduleRan
void
Unsubscribe from AdaptableDestroy
void
Unsubscribe from AdaptableReady
void
Unsubscribe from Fdc3Message
void
Unsubscribe from ColumnFilterChanged
void
Unsubscribe from ColumnFilterApplied
void
Unsubscribe from CellChanged
void
Unsubscribe from RowChanged
void
Unsubscribe from TeamSharingEntityChanged
void
Unsubscribe from CellSelectionChanged
VoidFunction
Event fired whenever AdapTable is Sorted
VoidFunction
Event fired whenever the Row Selection in AdapTable changes.
VoidFunction
Event fired whenever a shipped theme (light, dark, or os) is selected or re-applied
VoidFunction
Event fired whenever a System Status Message is displayed in AdapTable
VoidFunction
Event fired whenever an Alert is triggered in AdapTable.
VoidFunction
Event fired when Data has been imported
VoidFunction
Event fired whenever Cell Flashing is triggered in AdapTable.
VoidFunction
Event fired whenever the current Layout updates in AdapTable
VoidFunction
Event fired whenever a Calculated Columns is created / updated / deleted in AdapTable
VoidFunction
Event fired whenever Configure Button is clicked in a Custom Toolbar
VoidFunction
Event fired whenever a Grid Filter is applied in AdapTable
VoidFunction
Event fired whenever Dashboard State changes
Primarily used for rendering Custom toolbars.
() => void
Event fired before Adaptable State changes (before the action is processed)
() => void
Event fired whenever Adaptable State changes
() => void
Event fired whenever Adaptable State is reloaded
() => void
Event fired whenever a change occurs relating to live reports / data
Used in conjunction with AdapTable's partners OpenFin or ipushpull
() => void
Event fired when a Row Form is submitted
() => void
Event fired when a DataSet is Selected
() => void
Event fired when a Chart is Changed
() => void
Event fired when a Comment is Changed
VoidFunction
Event fired whenever a Note is added, edited or deleted in AdapTable
VoidFunction
Event fired whenever a Schedule is triggered in AdapTable
VoidFunction
Fired when Adaptable is up and running - has no arguments.
VoidFunction
Fired when Adaptable is destroyed
() => void
Event fired when an FDC3 message is sent(Raise Intent or Broadcast Context) or received (Intent or Context)
VoidFunction
Event fired whenever a Column Filter changes in AdapTable — including
incomplete editor drafts that are not yet applied.
VoidFunction
Event fired whenever a Column Filter is Applied in AdapTable (persisted;
grid filtering may run). Prefer ColumnFilterChanged + isApplied for new code.
VoidFunction
Event fired whenever a cell changes in the Grid
VoidFunction
Event fired when a row is added, deleted or updated in the Grid
VoidFunction
Event fired whenever a Shared Entity in Team Sharing changes
VoidFunction
Event fired whenever the Cell Selection in AdapTable changes.