A common scenario in AdapTable is where users want a cell to flash briefly when it changes.
This is performed through Flashing Alerts - with the added benefit that the flash can be customised (e.g. colour, duration, trigger) to the precise requirements of each user.
Flashing Alerts are actually a specialised type of Alert but are addressed separately in our documentation
Flashing Alert Definition
Flashing Alerts can be provided at design time via the
FlashingAlertDefinitions section of Alert Predefined Config or at runtime through the UI.
The Flashing Alert Definition object is defined as follows:
As can be seen it extends 2 interfaces, that each defines a separate area:
- BaseAlertDefinition - what triggers the Flashing Alert
- FlashingAlertProperties - how the Alert will behave / flash
Base Alert Definition
This is the same Base Definition that the standard Alert uses:
|Rule||When Alert should be triggered|
|Scope||Where Alert can be triggered: one, some or all columns or DataTypes|
For Flashing Alerts, this is typically set to Scope of a single column and a Predicate of 'Any Change' so that the column will flash whenever its value changes
Both Rule and Scope are fully configurable so that Flashing Alerts are triggered, instead, on custom changes
Flashing Alert Properties
The FlashingAlertProperties object defines the behaviour of the particular Flashing Alert, i.e. the Up, Down and Neutral change styles, duration and target (i.e. whether a single cell or whole row flashes):
|DownChangeStyle||Style for 'Down' value changes||Red BackColour|
|FlashDuration||Duration of Flash - can be number (in ms) or 'always'||500ms|
|FlashTarget||Should a cell or whole row flash||'cell'|
|NeutralChangeStyle||Style for 'Neutral' value changes||Gray BackColour|
|UpChangeStyle||Style for 'Up' value changes||Green BackColour|
NeutralChangeStyle properties are of type Adaptable Style.
Set the duration to 'always' if the cell/row should remain coloured until it is explicitly turned off by the user
Doing this will replicate the behaviour of the Updated Row function that was removed in Version 9
Default Flashing Properties
An alternative to setting the Flashing behaviour for each Flashing Alert Definition is to set default properties that will be used instead.
Setting default Flashing behaviour in Notification Options means it only needs to be done once
If this property is not provided and no properties are specified in the FlashingAlertDefinition then the AdapTable defaults are used
The order of priority for setting Flashing Properties is:
- A Flashing Alert Definition
- Properties provided at design-time in
flashingAlertDefaultPropertiesin Notification Options
- The default properties provided by AdapTable - which are:
Flashing Alert Example
In this example we have created 3 Flashing Alert Definitions:
- On ChangeLastOrder, ItemCost and OrderCost columns which will flash for half a second on any change
- On InvoicedCost column which will flash for half a second on any change
- The whole row with unlimited duration if the Currency column is equal to 'USD'