# Flashing Cell Technical Reference

Canonical page: https://www.adaptabletools.com/docs/technical-reference-flashing-cell

## Flashing Cell State

| Property | Type | Description |
| --- | --- | --- |
| [FlashingCellDefinitions](https://www.adaptabletools.com/docs/reference/flashingcellstate.md#flashingcelldefinitions) | [`FlashingCellDefinition`](https://www.adaptabletools.com/docs/reference/flashingcelldefinition.md)`[]` | Flashing Cell definitions. Each one names a column scope, a boolean rule, and what flashes. |

### Flashing Cell Definition

| Property | Type | Description | Default |
| --- | --- | --- | --- |
| [DownChangeStyle](https://www.adaptabletools.com/docs/reference/flashingcelldefinition.md#downchangestyle) | [`AdaptableStyle`](https://www.adaptabletools.com/docs/reference/adaptablestyle.md) | Style for &#39;Down&#39; value changes | Red BackColour |
| [FlashDuration](https://www.adaptabletools.com/docs/reference/flashingcelldefinition.md#flashduration) | `number \| 'always'` | Duration of Flash - can be number (in ms) or &#39;always&#39; | 500ms |
| [FlashTarget](https://www.adaptabletools.com/docs/reference/flashingcelldefinition.md#flashtarget) | [`FlashTargetTypes`](https://www.adaptabletools.com/docs/reference/flashtargettypes.md)` \| `[`FlashTargetTypes`](https://www.adaptabletools.com/docs/reference/flashtargettypes.md)`[]` | Should a cell or whole row flash | &#39;cell&#39; |
| [Name](https://www.adaptabletools.com/docs/reference/flashingcelldefinition.md#name) | `string` | Name of the Flashing Cell Definition |   |
| [NeutralChangeStyle](https://www.adaptabletools.com/docs/reference/flashingcelldefinition.md#neutralchangestyle) | [`AdaptableStyle`](https://www.adaptabletools.com/docs/reference/adaptablestyle.md) | Style for &#39;Neutral&#39; value changes | Gray BackColour |
| [Rule](https://www.adaptabletools.com/docs/reference/flashingcelldefinition.md#rule) | `string` | AdapTableQL boolean expression deciding when the Flashing Cell is triggered<br/>(evaluated per data change for Change; against live history for Observable),<br/>e.g. `ANY_CHANGE([price])` or `CHANGE_COUNT{[price], WITHIN(5m)} > 3` |   |
| [Scope](https://www.adaptabletools.com/docs/reference/flashingcelldefinition.md#scope) | [`ColumnScope`](https://www.adaptabletools.com/docs/reference/columnscope.md) | Which Columns, DataTypes or Column Types can Flash |   |
| [Type](https://www.adaptabletools.com/docs/reference/flashingcelldefinition.md#type) | [`FlashingCellType`](https://www.adaptabletools.com/docs/reference/flashingcelltype.md) | `'Change'` compares this edit with the previous value. `'Observable'` evaluates the rule against change history. When omitted, the definition is treated as `'Change'`. |   |
| [UpChangeStyle](https://www.adaptabletools.com/docs/reference/flashingcelldefinition.md#upchangestyle) | [`AdaptableStyle`](https://www.adaptabletools.com/docs/reference/adaptablestyle.md) | Style for &#39;Up&#39; value changes | Green BackColour |
| [IsReadOnly](https://www.adaptabletools.com/docs/reference/flashingcelldefinition.md#isreadonly) | `boolean` | Sets Entity to ReadOnly (overwriting a Strategy Entitlement of &#39;Full&#39;) |   |
| [IsSuspended](https://www.adaptabletools.com/docs/reference/flashingcelldefinition.md#issuspended) | `boolean` | Suspends (i.e. turns off) an Adaptable Object |   |

### Scope

<ApiTypeCard name="ColumnScope" href="/docs/reference/columnscope" choice>

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

<ApiMember name="{ All: true }" href="/docs/reference/columnscope">

<ApiMemberType>

`true`

</ApiMemberType>

Matches every column. `All` must be `true`.

</ApiMember>

<ApiMember name="{ DataTypes }" href="/docs/reference/columnscope">

<ApiMemberType>

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

</ApiMemberType>

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`.

</ApiMember>

<ApiMember name="{ ColumnIds }" href="/docs/reference/columnscope">

<ApiMemberType>

`string[]`

</ApiMemberType>

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

</ApiMember>

<ApiMember name="{ ColumnTypes }" href="/docs/reference/columnscope">

<ApiMemberType>

`string[]`

</ApiMemberType>

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

</ApiMember>

</ApiTypeCard>

`Type` is a [`FlashingCellType`](https://www.adaptabletools.com/docs/reference/flashingcelltype.md):

[See API: flashingcelltype](https://www.adaptabletools.com/docs/reference/flashingcelltype.md)

`FlashTarget` is a [`FlashTargetTypes`](https://www.adaptabletools.com/docs/reference/flashtargettypes.md):

[See API: flashtargettypes](https://www.adaptabletools.com/docs/reference/flashtargettypes.md)

`UpChangeStyle`, `DownChangeStyle` and `NeutralChangeStyle` are an [`AdaptableStyle`](https://www.adaptabletools.com/docs/reference/adaptablestyle.md):

| Property | Type | Description |
| --- | --- | --- |
| [ClassName](https://www.adaptabletools.com/docs/reference/adaptablestyle.md#classname) | `string` | CSS class added to the cell. Colour, font and border properties on this object are still applied. |

-------------

## Flashing Cell Options

| Property | Type | Description | Default |
| --- | --- | --- | --- |
| [defaultDownChangeStyle](https://www.adaptabletools.com/docs/reference/flashingcelloptions.md#defaultdownchangestyle) | [`AdaptableStyle`](https://www.adaptabletools.com/docs/reference/adaptablestyle.md) | Style for &#39;Down&#39; value changes | BackColor of `var(--ab-color-flash-down)` (red in the shipped themes) |
| [defaultFlashDuration](https://www.adaptabletools.com/docs/reference/flashingcelloptions.md#defaultflashduration) | `number \| 'always'` | Duration of Flash - can be number (in ms) or &#39;always&#39; | 500ms |
| [defaultFlashTarget](https://www.adaptabletools.com/docs/reference/flashingcelloptions.md#defaultflashtarget) | [`FlashTarget`](https://www.adaptabletools.com/docs/reference/flashtarget.md) | Should a cell or whole row flash | &#39;cell&#39; |
| [defaultNeutralChangeStyle](https://www.adaptabletools.com/docs/reference/flashingcelloptions.md#defaultneutralchangestyle) | [`AdaptableStyle`](https://www.adaptabletools.com/docs/reference/adaptablestyle.md) | Style for &#39;Neutral&#39; value changes | BackColor of `var(--ab-color-flash-neutral)` (gray in the shipped themes) |
| [defaultUpChangeStyle](https://www.adaptabletools.com/docs/reference/flashingcelloptions.md#defaultupchangestyle) | [`AdaptableStyle`](https://www.adaptabletools.com/docs/reference/adaptablestyle.md) | Style for &#39;Up&#39; value changes | BackColor of `var(--ab-color-flash-up)` (green in the shipped themes) |

`defaultFlashTarget` is a [`FlashTarget`](https://www.adaptabletools.com/docs/reference/flashtarget.md):

[See API: flashtarget](https://www.adaptabletools.com/docs/reference/flashtarget.md)

---------

## Flashing Cell API

| Method | Returns | Description |
| --- | --- | --- |
| [addFlashingCellDefinition(flashingCellDefinition)](https://www.adaptabletools.com/docs/reference/flashingcellapi.md#addflashingcelldefinition) | [`FlashingCellDefinition`](https://www.adaptabletools.com/docs/reference/flashingcelldefinition.md) | Adds a Flashing Cell Definition to State |
| [addFlashingCellDefinitions(flashingCellDefinitions)](https://www.adaptabletools.com/docs/reference/flashingcellapi.md#addflashingcelldefinitions) | [`FlashingCellDefinition`](https://www.adaptabletools.com/docs/reference/flashingcelldefinition.md)`[]` | Adds provided Flashing Cell Definitions |
| [clearAllFlashingCells()](https://www.adaptabletools.com/docs/reference/flashingcellapi.md#clearallflashingcells) | `void` | Clears all Cells and Rows which have been flashed (primarily used if duration is &#39;Always&#39;) |
| [deleteFlashingCellDefinition(flashingCellDefinition)](https://www.adaptabletools.com/docs/reference/flashingcellapi.md#deleteflashingcelldefinition) | `void` | Deletes a Flashing Cell |
| [editFlashingCellDefinition(flashingCellDefinition)](https://www.adaptabletools.com/docs/reference/flashingcellapi.md#editflashingcelldefinition) | [`FlashingCellDefinition`](https://www.adaptabletools.com/docs/reference/flashingcelldefinition.md) | Edits Flashing Cell Definition in State with given one |
| [editFlashingCellDefinitions(flashingCellDefinitions)](https://www.adaptabletools.com/docs/reference/flashingcellapi.md#editflashingcelldefinitions) | [`FlashingCellDefinition`](https://www.adaptabletools.com/docs/reference/flashingcelldefinition.md)`[]` | Edits provided Flashing Cell Definitions |
| [findFlashingCellDefinitions(flashingCellLookupCriteria)](https://www.adaptabletools.com/docs/reference/flashingcellapi.md#findflashingcelldefinitions) | [`FlashingCellDefinition`](https://www.adaptabletools.com/docs/reference/flashingcelldefinition.md)`[]` | Find all Flashing Cell Definitions which match the given criteria |
| [getActiveFlashingCellDefinitions()](https://www.adaptabletools.com/docs/reference/flashingcellapi.md#getactiveflashingcelldefinitions) | [`FlashingCellDefinition`](https://www.adaptabletools.com/docs/reference/flashingcelldefinition.md)`[]` | Retrieves all active (non-suspended) cell Definitions in Flashing Cell State |
| [getFlashingCellDefinitionById(id)](https://www.adaptabletools.com/docs/reference/flashingcellapi.md#getflashingcelldefinitionbyid) | [`FlashingCellDefinition`](https://www.adaptabletools.com/docs/reference/flashingcelldefinition.md) | Retrieves Flashing Cell Definition by the technical ID (from `FlashingCellState`) |
| [getFlashingCellDefinitionByName(name)](https://www.adaptabletools.com/docs/reference/flashingcellapi.md#getflashingcelldefinitionbyname) | [`FlashingCellDefinition`](https://www.adaptabletools.com/docs/reference/flashingcelldefinition.md)` \| undefined` | Retrieves a Flashing Cell Definition by its Name |
| [getFlashingCellDefinitions()](https://www.adaptabletools.com/docs/reference/flashingcellapi.md#getflashingcelldefinitions) | [`FlashingCellDefinition`](https://www.adaptabletools.com/docs/reference/flashingcelldefinition.md)`[]` | Retrieves all Flashing Cell Definitions in Flashing Cell State |
| [getFlashingCellFlashTarget(flashingCellDefinition)](https://www.adaptabletools.com/docs/reference/flashingcellapi.md#getflashingcellflashtarget) | [`FlashingCellDefinition`](https://www.adaptabletools.com/docs/reference/flashingcelldefinition.md)`['FlashTarget']` | Returns `FlashTarget` of the given Flashing Cell Definition |
| [getFlashingCellState()](https://www.adaptabletools.com/docs/reference/flashingcellapi.md#getflashingcellstate) | [`FlashingCellState`](https://www.adaptabletools.com/docs/reference/flashingcellstate.md) | Retrieves Flashing Cell section from Adaptable State |
| [getSuspendedFlashingCellDefinitions()](https://www.adaptabletools.com/docs/reference/flashingcellapi.md#getsuspendedflashingcelldefinitions) | [`FlashingCellDefinition`](https://www.adaptabletools.com/docs/reference/flashingcelldefinition.md)`[]` | Retrieves all suspended Cell Definitions in Flashing Cell State |
| [isAnyFlashingCellActive()](https://www.adaptabletools.com/docs/reference/flashingcellapi.md#isanyflashingcellactive) | `boolean` | Is there any cells/rows currently being flashed |
| [setFlashingCellDefinitions(flashingCellDefinitions)](https://www.adaptabletools.com/docs/reference/flashingcellapi.md#setflashingcelldefinitions) | `void` | Sets a collection of Flashing Cell Definitions into State |
| [showFlashingCell(flashingCellToShow)](https://www.adaptabletools.com/docs/reference/flashingcellapi.md#showflashingcell) | `void` | Evaluates the given Flashing Cell Definition and flashes the correspondent cells/rows |
| [suspendAllFlashingCellDefinition()](https://www.adaptabletools.com/docs/reference/flashingcellapi.md#suspendallflashingcelldefinition) | `void` | Suspends all FlashingCell Definitions |
| [suspendFlashingCellDefinition(flashingCellDefinition)](https://www.adaptabletools.com/docs/reference/flashingcellapi.md#suspendflashingcelldefinition) | [`FlashingCellDefinition`](https://www.adaptabletools.com/docs/reference/flashingcelldefinition.md) | Suspends a Flashing Cell Definition |
| [unSuspendAllFlashingCellDefinition()](https://www.adaptabletools.com/docs/reference/flashingcellapi.md#unsuspendallflashingcelldefinition) | `void` | Activates all suspended Flashing Cell Definition |
| [unSuspendFlashingCellDefinition(flashingCellDefinition)](https://www.adaptabletools.com/docs/reference/flashingcellapi.md#unsuspendflashingcelldefinition) | [`FlashingCellDefinition`](https://www.adaptabletools.com/docs/reference/flashingcelldefinition.md) | 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`](https://www.adaptabletools.com/docs/reference/flashingcelldisplayedinfo.md) object which contains one property:

| Property | Type | Description |
| --- | --- | --- |
| [flashingCell](https://www.adaptabletools.com/docs/reference/flashingcelldisplayedinfo.md#flashingcell) | [`AdaptableFlashingCell`](https://www.adaptabletools.com/docs/reference/adaptableflashingcell.md) | What flashed: the cell or row, and the change that caused the flash. |
| [adaptableContext](https://www.adaptabletools.com/docs/reference/flashingcelldisplayedinfo.md#adaptablecontext) | `any` | Custom application Context provided in `AdaptableOptions.adaptableContext` |

This `flashingCell` property is of type [`AdaptableFlashingCell`](https://www.adaptabletools.com/docs/reference/adaptableflashingcell.md) defined as follows:

| Property | Type | Description |
| --- | --- | --- |
| [cellDataChangedInfo](https://www.adaptabletools.com/docs/reference/adaptableflashingcell.md#celldatachangedinfo) | [`CellDataChangedInfo`](https://www.adaptabletools.com/docs/reference/celldatachangedinfo.md) | Data change which triggered the FlashingCell |
| [direction](https://www.adaptabletools.com/docs/reference/adaptableflashingcell.md#direction) | `'up' \| 'down' \| 'neutral'` | Direction of the change: &#39;up&#39;, &#39;down&#39; or &#39;neutral&#39; |
| [flashColumnIds](https://www.adaptabletools.com/docs/reference/adaptableflashingcell.md#flashcolumnids) | `Record<string, boolean>` | Column Ids that are flashing |
| [flashingCellDefinition](https://www.adaptabletools.com/docs/reference/adaptableflashingcell.md#flashingcelldefinition) | [`FlashingCellDefinition`](https://www.adaptabletools.com/docs/reference/flashingcelldefinition.md) | Rule that caused the FlashingCell to fire |
| [flashTarget](https://www.adaptabletools.com/docs/reference/adaptableflashingcell.md#flashtarget) | [`FlashingCellDefinition`](https://www.adaptabletools.com/docs/reference/flashingcelldefinition.md)`['FlashTarget']` | What will flash (e.g. Cell, Row) |
| [rowPrimaryKey](https://www.adaptabletools.com/docs/reference/adaptableflashingcell.md#rowprimarykey) | `string` | Primary Key Value of Row which is flashing |

`cellDataChangedInfo` is a [`CellDataChangedInfo`](https://www.adaptabletools.com/docs/reference/celldatachangedinfo.md):

| Property | Type | Description |
| --- | --- | --- |
| [changedAt](https://www.adaptabletools.com/docs/reference/celldatachangedinfo.md#changedat) | `number` | Timestamp of change occurrence (in milliseconds) |
| [column](https://www.adaptabletools.com/docs/reference/celldatachangedinfo.md#column) | [`AdaptableColumn`](https://www.adaptabletools.com/docs/reference/adaptablecolumn.md)`<TData>` | Column in which cell is situated |
| [newValue](https://www.adaptabletools.com/docs/reference/celldatachangedinfo.md#newvalue) | `any` | Value after the change.<br/><br/>Absent when `trigger` is `live`. |
| [oldValue](https://www.adaptabletools.com/docs/reference/celldatachangedinfo.md#oldvalue) | `any` | Value before the change.<br/><br/>Absent when `trigger` is `live`. |
| [preventEdit](https://www.adaptabletools.com/docs/reference/celldatachangedinfo.md#preventedit) | `boolean` | Whether the change was prevented by a validation rule |
| [primaryKeyValue](https://www.adaptabletools.com/docs/reference/celldatachangedinfo.md#primarykeyvalue) | `any` | Primary Key Column&#39;s value for the row where edited cell is situated |
| [rowData](https://www.adaptabletools.com/docs/reference/celldatachangedinfo.md#rowdata) | `TData` | Data in the Row |
| [rowNode](https://www.adaptabletools.com/docs/reference/celldatachangedinfo.md#rownode) | `IRowNode<TData>` | AG Grid RowNode that contains the cell |
| [trigger](https://www.adaptabletools.com/docs/reference/celldatachangedinfo.md#trigger) | `'edit' \| 'tick' \| 'undo' \| 'aggChange' \| 'calculatedColumnChange' \| 'live'` | What triggered the change - user, background change, a reverted change, a<br/>derived update on a Calculated Column whose source value changed, or a<br/>live Alert rule turning true for the row (`live`: no old / new value,<br/>`column` is the rule&#39;s first Scope column when it has one). |

### Event Subscription

Subscribing to the Events is done the same as with all [Adaptable Events](https://www.adaptabletools.com/docs/technical-reference-adaptable-events/index.md):

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