Row Change Alerts

Summary

  • Row Change Alerts are Alerts which can be fired when the Rows in the Grid change
  • This can be either when:
    • a new Row is added to AG Grid
    • an existing Row is deleted from AG Grid

AdapTable offers 2 Alerts which fire in response to changes in the number of rows in AG Grid's data source:

  • ROW_ADDED - wraps the ROW_ADDED Observable Expression Function
  • ROW_REMOVED - wraps the ROW_REMOVED Observable Expression Function

Note

These are both specialised types of Observable Alert which look for changes in the Grid or given rows

Caution

When defining the Alert in Initial State, the Scope in the Alert Definition should be set to All

Added Row Alert

The ROW_ADDED Expression can be used to create an Observable Alert which will fire each time a new row is added to AG Grid.

Hint

  • If adding the new row programatically, use Grid API's' addGridData function (see Managing Row Data for more info)
  • Don't directly use applyTransaction (or applyTransactionAsync) in AG Grid's API as it bypasses new row detection
Alerts: Row Added
Fork
  • This demo has a ROW_ADDED Alert which fires when a now row is added to the Grid
  • We added a Highlight Row Behaviour to easily see which Row was added
  • The new Row can be added to the Grid in 2 ways:
Try It Out
  • You can mimic adding a new Row in one of 2 ways - both of which will trigger the Alert:
    • Click the Add Python Row Dashboard Button
    • Click the Create Button (which automatically displays an empty Row Form allowing you easily to add the new Row)

Added Row Conditional Alert

Because ROW_ADDED is an Observable Alert, it can be provided with an additional WHERE clause.

This specifies when the Alert should fire (ie. what extra requirement is available)

Caution

  • If creating a Conditional Row Changed Alert in the UI, you will need to select the, fuller, Observable Alert option
  • This option contains a stop that renders the Expression Editor which is where the WHERE clause can be added
Alerts: Row Added with WHERE
Fork
  • This demo contains an Add Row Warning Alert but the Rule has a WHERE clause in the Expression, specifying the Alert should only fire when the new Row:
    • has a Language of TypeScript
    • and Has Wiki is true
  • We have added a Dashboard Button which opens an Add Row Form to enable the new row to be added
Try It Out
  • Click the 'Add New Row' Button in the Dashboard to open an Add Row Form
  • Provide any Name, select 'TypeScript' for Lanugage and check Has Wiki and click Save
  • The new Row will be added to the Grid and the Alert will fire

Removed Row Alert

Another commonly used Observable Alert requirement is row removal, ie. to fire an Alert when rows have been from the Grid.

The ROW_REMOVED Expression can be used to create an Observable Alert which will fire each time a Row is removed from AG Grid.

Alerts: Row Removed
Fork
Try It Out