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:

  1. Display in the Alert Toolbar, Tool Panel or Status Bar (including a running count of Alerts fired)
  2. 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 duration property of Notifications Options
    • Set this to always to ensure notifictions need to be manually dismissed
  • 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

  • Log to the Console a message detailing the Data Change and the Alert Definition

Alerts: Alert Behaviours
Fork
  • This demo fires an Alert when any value in Github Stars column 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 Type colour (here Orange for Warning)
    • Highlights the Row that triggered the Alert using a custom Adaptable Style (white on purple)
    • Jumps to the Cell which triggered the Alert
  • We set the rowHighlightDuration and cellHighlightDuration properties to 3 and 1.5 seconds respectively to see the changes better

Expand to see the Alert Definition

Try It Out

Click the Update First Row or Update Last Row Custom Toolbar Buttons to trigger the Alert and see the Behaviours