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:
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 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,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 to -
callback- object containing relevant information to the Adaptable Event and why it firedNote
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:
| Property | Description |
|---|---|
| adaptableApi | Adaptable Api object |
| adaptableContext | Custom application Context provided in AdaptableOptions.adaptableContext |
| adaptableId | Id of current AdapTable instance |
| adaptableStateKey | Current Adaptable State Key |
| clientTimestamp | Time on user's computer |
| userName | 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 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 Event | When Fired |
|---|---|
| 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 |
| 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 |
| 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' |
| 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 |
| Schedule Triggered | A Reminder or a Report Schedule has been triggered |
| 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 Changed | A Theme has been selected or edited |
Event API
The EventAPI section of Adaptable API is used to publish Adaptable Events