Flashing Cell Technical Reference

View as Markdown

Flashing Cell State

FlashingCellState

Flashing Cell section of Adaptable State, including Initial State.

Each definition watches columns in Scope and flashes when Rule is true. FlashTarget is 'cell' (the default), 'row', 'aggFuncCell', or a list of those. UpChangeStyle, DownChangeStyle and NeutralChangeStyle colour the flash. FlashDuration is milliseconds or 'always' (the default is 500).

Extends

BaseState

Flashing Cell definitions. Each one names a column scope, a boolean rule, and what flashes.

Flashing Cell Definition

FlashingCellDefinition

Flashes a cell, a row, or an aggregated cell when a rule matches.

Scope and Rule are required. Type is 'Change' (this edit against the previous value) or 'Observable' (change history such as CHANGE_COUNT). When Type is omitted it is treated as 'Change'. Suspend with IsSuspended.

Style for 'Down' value changes

Default

Red BackColour

FlashDuration?

number | 'always'

Duration of Flash - can be number (in ms) or 'always'

Default

500ms

Should a cell or whole row flash

Default

'cell'

Name

string

Name of the Flashing Cell Definition

Style for 'Neutral' value changes

Default

Gray BackColour

Rule

string

AdapTableQL boolean expression deciding when the Flashing Cell is triggered
(evaluated per data change for Change; against live history for Observable),
e.g. ANY_CHANGE([price]) or CHANGE_COUNT{[price], WITHIN(5m)} > 3

Which Columns, DataTypes or Column Types can Flash

'Change' compares this edit with the previous value. 'Observable' evaluates the rule against change history. When omitted, the definition is treated as 'Change'.

Style for 'Up' value changes

Default

Green BackColour

IsReadOnly?

boolean

Sets Entity to ReadOnly (overwriting a Strategy Entitlement of 'Full')

IsSuspended?

boolean

Suspends (i.e. turns off) an Adaptable Object

Scope

ColumnScope

Which columns an object applies to. Set exactly one shape.

One of

Matches every column. All must be true.

{ DataTypes }

('text' | 'number' | 'boolean' | 'date' | 'textArray' | 'numberArray')[]

Data types to match, for example ['number'] or ['text', 'textArray']. Object, tuple and unknown columns are not scope data types. Name those columns with ColumnIds.

Column ids to match. These are AG Grid colId values.

AG Grid column type names, the strings set on colDef.type.

Type is a FlashingCellType:

Value
'Change'
'Observable'

FlashTarget is a FlashTargetTypes:

Value
'row'
'cell'
'aggFuncCell'

UpChangeStyle, DownChangeStyle and NeutralChangeStyle are an AdaptableStyle:

AdaptableStyle

Colours, font and border for a cell, header or highlight.

Text properties (ForeColor, FontWeight, FontStyle, TextDecoration, FontSize, Alignment) and box properties (BackColor, BorderColor, BorderRadius) are applied together. ClassName adds a CSS class and does not turn the other properties off. A Styled Column can take just the text slice (Font) or just the box slice (Cell).

CellFontStyle

The "text" half of an AdaptableStyle: everything that affects the rendering of text (and, by convention, the alignment of the cell's primary content block — for plain text that is text-align, for Badge it is the alignment of the badge row).

Used as a Font? slot on Styled Columns whose renderer paints a non-text primary content (Gradient tint, Percent Bar, Bullet Chart) so the column can still control the cell's text styling without inheriting any other properties from a Format Column.

Alignment?

Alignment

Align to Left, Right or Center

FontSize?

'XSmall' | 'Small' | 'Medium' | 'Large' | 'XLarge'

Size of font: XSmall, Small, Medium, Large or XLarge

FontStyle?

'Normal' | 'Italic'

Style of font: Normal or Italic

FontWeight?

'Normal' | 'Bold'

Weight of font: Normal or Bold

ForeColor?

string

Font colour in cell: hex, rgb(a) or name

TextDecoration?

'None' | 'Underline' | 'Overline' | 'LineThrough'

Decoration of font: None, Underline, Overline or LineThrough

CellBoxStyle

The "box" half of an AdaptableStyle: everything that paints the cell box (background colour and the border that wraps the cell).

Used as a Cell? slot on Styled Columns whose renderer paints into the cell content but leaves the cell chrome alone (Rating, Sparkline) so the column can opt-in to a tinted/bordered cell without inheriting other properties from a Format Column.

BackColor?

string

Colour background of cell: hex, rgb(a) or name

Colour of cell border: hex, rgb(a) or name

Rounds corners of an element's outer border edge; equivalent of CSS border-radius

ClassName?

string

CSS class added to the cell. Colour, font and border properties on this object are still applied.


Flashing Cell Options

FlashingCellOptions

Properties for Flashing Cell

Style for 'Down' value changes

Default

BackColor of var(--ab-color-flash-down) (red in the shipped themes)

defaultFlashDuration?

number | 'always'

Duration of Flash - can be number (in ms) or 'always'

Default

500ms

Should a cell or whole row flash

Default

'cell'

Style for 'Neutral' value changes

Default

BackColor of var(--ab-color-flash-neutral) (gray in the shipped themes)

Style for 'Up' value changes

Default

BackColor of var(--ab-color-flash-up) (green in the shipped themes)

defaultFlashTarget is a FlashTarget:

Value
'row'
'cell'

Flashing Cell API

FlashingCellApi

Flashing Cell definitions, and flashing a cell when its value changes.

Clears all Cells and Rows which have been flashed (primarily used if duration is 'Always')

Edits Flashing Cell Definition in State with given one

Find all Flashing Cell Definitions which match the given criteria

Retrieves all active (non-suspended) cell Definitions in Flashing Cell State

Retrieves Flashing Cell Definition by the technical ID (from FlashingCellState)

Retrieves a Flashing Cell Definition by its Name

Retrieves all Flashing Cell Definitions in Flashing Cell State

Returns FlashTarget of the given Flashing Cell Definition

Retrieves Flashing Cell section from Adaptable State

Retrieves all suspended Cell Definitions in Flashing Cell State

Is there any cells/rows currently being flashed

Sets a collection of Flashing Cell Definitions into State

Evaluates the given Flashing Cell Definition and flashes the correspondent cells/rows

Suspends all FlashingCell Definitions

Activates all suspended Flashing Cell Definition

Activates a suspended Flashing Cell Definition


Flashing Cell Displayed Event

The FlashingCellDisplayedEvent fires when a Cell or Row has flashed.

EventInfo

The Flashing Cell Displayed Event has a FlashingCellDisplayedInfo object which contains one property:

This flashingCell property is of type AdaptableFlashingCell defined as follows:

AdaptableFlashingCell

A cell or row that has just flashed.

flashingCellDefinition is the rule. cellDataChangedInfo is the change that triggered it, when there is one. direction is up, down or neutral. flashTarget is what flashed (cell or row).

Data change which triggered the FlashingCell

direction

'up' | 'down' | 'neutral'

Direction of the change: 'up', 'down' or 'neutral'

flashColumnIds

Record<string, boolean>

Column Ids that are flashing

Rule that caused the FlashingCell to fire

What will flash (e.g. Cell, Row)

Primary Key Value of Row which is flashing

cellDataChangedInfo is a CellDataChangedInfo:

CellDataChangedInfo

Defines a Cell Edit - includes full details of old and new values, the column and the enclosing Row

changedAt

number

Timestamp of change occurrence (in milliseconds)

Column in which cell is situated

Value after the change.

Absent when trigger is live.

Value before the change.

Absent when trigger is live.

preventEdit?

boolean

Whether the change was prevented by a validation rule

Primary Key Column's value for the row where edited cell is situated

rowData?

TData

Data in the Row

rowNode?

IRowNode<TData>

AG Grid RowNode that contains the cell

trigger?

'edit' | 'tick' | 'undo' | 'aggChange' | 'calculatedColumnChange' | 'live'

What triggered the change - user, background change, a reverted change, a
derived update on a Calculated Column whose source value changed, or a
live Alert rule turning true for the row (live: no old / new value,
column is the rule's first Scope column when it has one).

Event Subscription

Subscribing to the Events is done the same as with all Adaptable Events:

api.eventApi.on('FlashingCellDisplayed', (eventInfo: FlashingCellDisplayedInfo) => {
    // do something with the info
});