Column Formatting Technical Reference

Summary

  • Column Formats and Styles are defined in Format Column Initial Adaptable State
  • Custom Display Formats can be provided in Format Column Options
  • Run-time access to Formats and Sytles is via the Format Column API Section of Adaptable API

Format Column State

The Format Column section of Initial Adaptable State contains a collection of FormatColumn objects:

PropertyDescription
FormatColumnsCollection of Format Columns

Caution

The order of elements is important as it defines their Evaluation Precedence

Format Column

Each Format Column object is defined as follows:

PropertyDescriptionDefault
ColumnGroupScopeWhen to format Columns in Column Groups ('Expanded', 'Collapsed', 'Both')
DisplayFormatDisplay Format to apply to Column can be Numeric, String or Date
NameName of the Format Column definition
RowScopeWhich types of Rows to apply format (data, grouped, summary, total)
RuleRule to decide whether to apply Format; if undefined Format is always applied
ScopeWhere Format will be applied: whole Row, some Columns, or Columns of DataType
StyleAdapTable Style to apply
TargetWhere in Column to apply Format (cell or columnHeader)'cell'
IsReadOnlySets Entity to ReadOnly (overwriting a Strategy Entitlement of 'Full')
IsSuspendedSuspends (i.e. turns off) an Adaptable Object

Style

Each Style object is an Adaptable Style which defined as follows:

PropertyDescription
AlignmentAlign to Left, Right or Center
BackColorColour background of cell: hex, rgb(a) or name
BorderColorColour of cell border: hex, rgb(a) or name
BorderRadiusRounds corners of an element's outer border edge; equivalent of CSS border-radius
ClassNameExisting CSS Class; use instead of setting other object properties
FontSizeSize of font: XSmall, Small, Medium, Large or XLarge
FontStyleStyle of font: Normal or Italic
FontWeightWeight of font: Normal or Bold
ForeColorFont colour in cell: hex, rgb(a) or name
TextDecorationDecoration of font: None, Underline, Overline or LineThrough

Display Formats

The DisplayFormat property is of type AdaptableFormat which can be one of 3 objects:

Numeric Format

The numberformatteroptions provides Numeric Display Formats :

PropertyDescription
AbsReturns absolute value of cell value
CeilingReturns smallest integer greater than cell value
ContentReplaces cell value with supplied value (that can contain Template Literals)
EmptyShow nothing in cell (but underlying value remains)
FloorReturns largest integer cell value
FractionDigitsNumber of digits to show in Fractions (up to 20)
FractionSeparatorSeparator to use in fractions
IntegerDigitsNumber of digits to show for Integers (up to 20)
IntegerSeparatorSeparator to use in Integers
MultiplierMultiplier to use on cell value
ParenthesesShows negative numbers in parentheses
PrefixPrefix to use before cell value
RoundRounds cell value
SuffixSuffix to use after cell value
TruncateTruncates cell value

String Format

The stringformatteroptions provides String Display Formats :

PropertyDescription
CaseSets text to Upper or Lower case
ContentReplaces cell value; useful when using Condition (e.g. replace null with 'N/A')
EmptyShow nothing in cell (but underlying value remains)
PrefixPrefix to use before the cell text
SuffixSuffix to use after the cell text
TrimTrims text (both start and end)

Date Format

The dateformatteroptions provides Date Display Formats :

PropertyDescription
PatternPattern to use for Date Format

Format Column Options

The Format Column Options section of Adaptable Options is used to provide Custom Display Formats:

PropertyDescription
customDisplayFormattersCustom Formatters to use in Format Column Module

Format Column API

The Format Column API section of Adaptable API is primarily used to format and style columns and manage conditions:

MethodDescription
addFormatColumn(formatColumn)Adds a Format Column to Format Column State
addFormatColumns(formatColumns)Adds Format Columns to Format Column State
decrementFormatColumnPrecedence(formatColumn)Decrement the precedence of the given FormatColumn
deleteAllFormatColumns()Deletes all Format Columns in the State
deleteFormatColumn(formatColumn)Deletes an existing Format Column
editFormatColumn(formatColumn)Edits the Format Column
findFormatColumns(formatColumnLookupCriteria)Find all Flashing Cell Definitions which match the given criteria
getActiveFormatColumns(config)Retrieves all active (not-suspended) Format Columns in Adaptable State
getDisplayFormatForColumn(column, config)Retrieves the first Format Column's Adaptable Format for a given Column
getFormatColumnByName(name)Retrieves a Format Column by its Name
getFormatColumnByUuId(id, config)Retrieves Format Column by the technical ID (from FormatColumnState)
getFormatColumns(config)Retrieves all Format Columns in Adaptable State
getFormatColumnsForColumn(column, config)Gets all FormatColumns which are defined for the given column
getFormatColumnsForColumnId(columnId, config)Gets all FormatColumns which are defined for the column with the given columnId
getFormatColumnState()Retrieves Format Column section from Adaptable State
getSuspendedFormatColumns(config)Retrieves all suspended Format Columns in Adaptable State
hasCustomDisplayFormatter(formatColumn)Checks if a Format Column contains a Custom Display Formatter
incrementFormatColumnPrecedence(formatColumn)Increment the precedence of the given FormatColumn
openFormatColumnSettingsPanel()Opens Settings Panel with Format Column section selected and visible
suspendAllFormatColumn()Suspends all Format Columns
suspendFormatColumn(formatColumn)Suspends an Format column
unSuspendAllFormatColumn()Activates all suspended Format Column
unSuspendFormatColumn(formatColumn)Suspends an Format column