Alert Behaviours
Summary
- AdapTable provides many options for how an Alert should behave once it is triggered, including:
- highlighting and / or jumping to the triggering cell or row
- showing a Notification (which can include custom forms and multiple action buttons)
All Alerts, when they are triggered, will perform 2 actions:
- Display in the Alert Toolbar, Tool Panel or Status Bar (including a running count of Alerts fired)
- Trigger the Alert Fired Event providing full details of the Data Change and Alert Definition
But there are many other behaviours that can be set for an Alert including:
-
Display a Toast Notification - probably the most common Alert Behaviour: AdapTable displays a Toast Notification (with an optional Form or Action buttons) when an important Alert fires
Hint
- The default value of 3 seconds can be changed in the
durationproperty of Notifications Options - Set this to
alwaysto ensure notifictions need to be manually dismissed
- The default value of 3 seconds can be changed in the
-
Highlight the Cell (or Row) where the data changed that triggered the Alert
-
Jump to Cell (or Row) so AG Grid displays the row which contains the cell that triggered the Alert
-
Show the Alert details in a bespoke Div element (that you specify in Container Options)
-
Prevent the Cell Edit from happening when they break the rule set in the Alert Definition
Note
- This is described in more detail in Validation Alerts
-
Log to the Console a message detailing the Data Change and the Alert Definition
- This demo fires an Alert when any value in
Github Starscolumn is changed. - The Alert Definition is configured with these behaviours wen the Alert is triggered:
- Highlights the Cell that triggered the Alert using the Alert's
Message Typecolour (here Orange forWarning) - Highlights the Row that triggered the Alert using a custom Adaptable Style (white on purple)
- Jumps to the Cell which triggered the Alert
- Highlights the Cell that triggered the Alert using the Alert's
- We set the
rowHighlightDurationandcellHighlightDurationproperties to 3 and 1.5 seconds respectively to see the changes better
Expand to see the Alert Definition
Click the Update First Row or Update Last Row Custom Toolbar Buttons to trigger the Alert and see the Behaviours