Configuring Cell Flashing

Summary

  • Developers are able to set default properties for Flashing Cells
  • These override the AdapTable defaults and are used when turning on Flashing from the Column Menu
  • These defaults can themselves, in turn, be overridden, when creating a Flashing Cell Definition

Flashing, like everything in AdapTable, is highly configurable.

Setting Flashing Defaults

By default when Flashing is turned on for a column these values are used by AdapTable:

  • Up Change Style
  • Down Change Style
  • Neutral Change Style
  • Duration - 500ms

  • Flash Target - cell

Like with any AdapTable object, different properties can be set for a particular Flashing Cell Definition - either at runtime in the Flashing Wizard or at design time in Flashing Cell Initial State.

Those provided properties will then be used, in preference to the default values.

However, it is additionally possible for developers to set their own default values for each of these properties.

Hint

This is useful as it allows for Flashing to be turned on for a Column via the Column Menu

These "new" defaults are supplied in the Flashing Cell Options section of Adaptable Options.

Note

They will only be used if the equivalent property is not included in the Flashing Cell Definition (which takes priority)

Deep Dive

Rules of Precedence when using Flashing Cells

Default Change Styles

As noted, AdapTable provides 3 properties in Flashing Cell Options which enable developers to set the Styles for flashing changes.

All 3 properties are Adaptable Styles which is used in multiple Modules in AdapTable, and contains fore, back and border colours and a selection of font-related properties.

Caution

  • Unlike with other AdapTable Style use cases, you cannot provide CSS ClassNames for Flashing Cells
  • Instead only the provided properties of the Adaptable Style object can be used

The default for these properties as set by AdapTable is to set just one property, BackColor, as follows:

  • defaultUpChangeStyle - Green
  • defaultDownChangeStyle - Red
  • defaultNeutralChangeStyle - Gray

Note

As the Style object can be used in Initial State (e.g for Format Columns>) the properties use pascal, not camel, casing

defaultUpChangeStyle

Default: Green Back Colour
The default Style to Flash a Cell when it changes in an upward direction

defaultDownChangeStyle

Default: Red Back Colour
The default Style to Flash a Cell when it changes in a downward direction

defaultNeutralChangeStyle

Default: Gray Back Colour
The default Style to Flash a Cell when it changes in a neutral direction

Default Flash Duration

By default Cells (and Rows) will flash for half a second.

This can be changed by using the defaultFlashDuration property in Flashing Cell Options.

Either an alternative duration can be provided, or set to 'always' so the Style renders indefinitely.

defaultFlashDuration

Default: 500ms
number | 'always'
Duration of Flashing Cell

Default Flash Target

By default the Target for all Flashes is the Cell that contains the changed value.

The defaultFlashTarget property in Flashing Cell Options allows the whole Row to flash by default.

defaultFlashTarget

Default: cell
row | cell
Whether default behaviour is for a Cell or the whole Row to flash
Changing Flashing Cell Defaults
Fork
  • In this example we override some default Flashing Cell properties:
    • New (more pastel-based) default up, down and neutral change styles are provided
    • duration is increased to 1 second
  • These defaults are used by the Github Stars and Github Watchers Columns
  • However the Open Issues and Closed Issues Columns override these defaults - they provide:
    • bespoke styles of Blue (up change) and Brown (down change)
    • a Duration of 350ms

See the Flashing Cell Definitions

Defining Flashing Cell Rules

Cell Flashing rules can be defined at design-time via the Flashing Cell section of Initial Adaptable State.

This will ensure they are applied when the Application first loads and will be stored with Adaptable State.

In addition default values can be set for the Styles used in Flashing.

FAQ

Can we change the default colours at run-time? No, default colours can only be set at design time in Flashing Cell Options