Styling Column Technical Reference

Summary

  • Styles Columns are configured at design-time in Initial Adaptable State
  • Styled Column API is used for run time access to Styled Columns

Styled Column State

The Styled Column section of Adaptable State contains a collection of StyledColumn objects:

PropertyDescription
StyledColumnsCollection of Special Column Styles

The Styled Column object is defined as follows:

PropertyDescription
BadgeStyleDisplays cell values in Column as a Badge
ColumnIdColumn being styled
GradientStyleStyles a numeric column with a Gradient
PercentBarStyleStyles a numeric column so each cell displays a 'Bar'
SparklineStyleDisplays a Sparkline Chart in an array column
IsReadOnlySets Entity to ReadOnly (overwriting a Strategy Entitlement of 'Full')
IsSuspendedSuspends (i.e. turns off) an Adaptable Object

Gradient Style

The Gradient Column object is of type NumericStyledColumn defined as follows:

PropertyDescriptionDefault
CellRangesRanges (e.g. to create traffic light effect)
ColumnComparisonCompares Cell values to another Column
RangeValueTypeUsed with Ranges; can be Number (any number or Col-Min/Col-Max) or 'Percentage' (values 0-100)Number

Percent Bar Style

The Percent Bar Style also inherits from NumericStyledColumn:

PropertyDescriptionDefault
CellRangesRanges (e.g. to create traffic light effect)
ColumnComparisonCompares Cell values to another Column
RangeValueTypeUsed with Ranges; can be Number (any number or Col-Min/Col-Max) or 'Percentage' (values 0-100)Number

But it also contains a few additional properties:

PropertyDescriptionDefault
BackColorBackground colour for 'Percent Bar'; leave unset if none requiredundefined
CellTextWhether Cell shows Cell Value, Percent Value, both or none
CellTextPositionPosition of text in Cell relative to Percent Bar, "Above", "Below" or "Merged"Below
ToolTipTextWhether Tooltip shows Cell Value, Percent Value, both or none

Cell Ranges

Both Gradient Column and Percent Bar contain a CellRanges property of type CellColorRange:

PropertyDescription
ColorCell colour to use for values that fall inside Range
MaxEnd number of Range
MinStart number of Range
ReverseGradientReverses the Gradient so the lower the cell value the darker the colour

Column Comparison

Gradient Column and Percent Bar also both contain a ColumnComparison property of type ColumnComparison:

PropertyDescription
ColorColour to use for the Comparison
MaxValueEnd value - either numeric value or Column name
MinValueStart value - either numeric value or Column name

Badge Style

The BadgeStyle is defined as follows:

PropertyDescription
BadgesCollection of Badge Style Definitions
RowScopeWhich types of Rows should contain a Badge (data, grouped, summary)

Each BadgeStyleDefinition is defined as follows:

PropertyDescription
Expression
IconIcon to display in Badge
IconOnlyOnly show an Icon and no Cell text
IconPositionPosition of Icon in the Badge - 'Start' or 'End'
PredicateOptional Rule for deciding whether Badge is displayed
StyleStyle for the Badge

Sparkline Style

The Sparkline Style has a single options property which sets up the AG Grid Sparkline properties


Styled Column API

The Styled Column API section of Adaptable API contains functions for managing Styled Columns:

MethodDescription
addStyledColumn(styledColumn)Create a Styled column
canDisplaySparklines()Can this AdapTable instance display Sparklines (e.g. is AG Grid SparklinesModule installed)
deleteAllStyledColumns()Delete all Styled Columns in State
deleteStyledColumn(styledColumn)Delete a Styled column
editStyledColumn(styledColumn)Edits a Styled Column
getActiveStyledColumnForColumn(column)Returns a Styled Column for a given column
getActiveStyledColumns(config)Retrieves all active (not-suspended) Styled Columns in Adaptable State
getStyledColumnById(id, config)Retrieves Styled Column by Id
getStyledColumnForColumnId(columnId, config)Retrieves Styled Column for given Column Id
getStyledColumns(config)Retrieves all Styled Columns in Adaptable State
getStyledColumnState()Retrieves Styled Column section from Adaptable State
getSuspendedStyledColumns(config)Retrieves all suspended Styled Columns in Adaptable State
hasGradientStyle(columnId)Checks whether Column with given columnId has a Gradient Style applied
hasPercentBarStyle(columnId)Checks whether Column with given columnId has a PercentBar Style applied
isSparklineStyleStyledColumn(column)Checks whether Column is a Sparkline Column
openStyledColumnSettingsPanel()Open Styled Column section of Settings Panel
suspendAllStyledColumn()Suspends all Styled Columns
suspendStyledColumn(styledColumn)Suspends an active Styled Column
unSuspendAllStyledColumn()Activates all suspended Styled Column
unSuspendStyledColumn(styledColumn)Activates a suspended Styled Column