AdapTable fires a number of Events providing information about everything that is happening inside the grid.
Users can subscribe to these Events, and respond as appropriate, via the Adaptable Api.
In addition to these events, the Audit Log can be configured to fire an event whenever User State or underlying data changes.
All Events use the standard FDC3 Context Data Specification.
With the exception of AdaptableReady all Events follow the same pattern:
- They will publish an xxxEventArgs class.
- This will contain an xxxEventData array as the
dataproperty (the only property)
- The only item in this array will have an
idproperty of type xxxInfo
- This class will always include the Adaptable API together with any other relevant objects.
Subscribing to Events
You subscribe to an event using the
on method of the Event Api.
This takes 2 parameters:
- eventName - one of the Adaptable Events
- callback - of type xxxEventArgs
For example the definition of the LayoutUpdatedEvent is:
And so to subscribe to the event you could do:
Unsubscribing from Events
There is a parallel unsubsciption
off method in the Event Api.
This takes the same form as the
on method, so the definition for the LayoutUpdatedEvent is simply:
The Events which are currently fired by AdapTable are:
|AdaptableReady||Adaptable is initialised and ready for use (has no Args class)|
|LayoutUpdated||Current layout changes|
|SearchChanged||State has changed in any of the Search-related functions (e.g. Current Query, Filters, Data Source etc.)|
|SelectionChanged||User changes the Cell or Rows selection|
|GridDataChanged||User makes an edit in a Grid Cell or a ticking data change is made|
|ThemeChanged||The Theme in Adaptable has changed|
|AlertFired||An alert is triggered in Adaptable|
|ToolbarVisibilityChanged||A toolbar comes into view (useful for rendering Custom toolbars)|
|ToolbarButtonClicked||A custom button is clicked in the Dashboard|
|CustomToolbarConfigured||The 'configure' button is clicked in a Custom Toolbar|
|ActionColumnClicked||The button in an Action Column has been clicked|
|LiveDataChanged||Something happens related to the various 'live reports' that AdapTable offers|
Visit the AdapTable Demo Site to see a number of state-related demos