Column Formatting Technical Reference
Format Column State
FormatColumnState
Format Column section of Adaptable State, including Initial State.
Each entry styles cells, changes how a value is displayed, or both. Scope says where it applies. Rule limits it to matching rows; omit Rule to apply it on every row. Style sets colours and fonts. DisplayFormat changes the displayed value.
Format Columns to apply. Several can match the same cell. Their styles are combined, and the first definition in this list wins on a property both set. A Styled Column wins over a Format Column where both set the same property.
Caution
The order of elements is important as it defines their Evaluation Precedence
Format Column
FormatColumn
Colours a cell, changes how its value is displayed, or both.
Scope is required. Style and DisplayFormat can be set together. Omit Rule to apply the format on every row in scope. Target defaults to 'cell' ('columnHeader' formats the header). Suspend with IsSuspended.
When a format applies to a column inside a column group.
Omit it to apply the format whether the parent group is expanded or collapsed. 'Expanded' applies only while the parent group is expanded. 'Collapsed' applies only while it is collapsed. 'Both' applies in either state. A column that is the only leaf of a top-level group ignores an explicit scope.
Display Format to apply to Column. Can be a concrete AdaptableFormat
(Numeric, String or Date) or the name of a numeric preset such as'Percentage', 'Thousand', 'Million', 'Dollar', 'Sterling',
which is resolved at render time.
string
Name of the Format Column definition
Row kinds to skip. Each flag excludes that kind. When omitted, data, group, summary and total rows are all included.
string
AdapTableQL boolean expression (evaluated per row) deciding whether to apply the Format, e.g. [price] > 100; if undefined the Format is always applied
Where Format will be applied: whole Row, some Columns, or Columns of DataType
Colours, font and CSS class applied to the cell or header. Can be set together with DisplayFormat.
boolean
Sets Entity to ReadOnly (overwriting a Strategy Entitlement of 'Full')
boolean
Suspends (i.e. turns off) an Adaptable Object
Scope
ColumnScope
Which columns an object applies to. Set exactly one shape.
true
Matches every column. All must be true.
('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.
string[]
Column ids to match. These are AG Grid colId values.
string[]
AG Grid column type names, the strings set on colDef.type.
ColumnGroupScope is a ColumnGroupScope:
| Value |
|---|
'Expanded' |
'Collapsed' |
'Both' |
RowScope is a RowScope:
RowScope
Row kinds to skip.
Each flag, when true, skips that kind. A flag left unset includes that kind. When the whole RowScope is omitted, the feature decides: a Format Column includes every kind.
boolean
Exclude regular data rows
boolean
Exclude Group Rows
boolean
Exclude Summary Rows (used in Row Summaries)
boolean
Exclude Grand Total Rows (used in Aggregations)
Target is a FormatColumnTarget:
| Value |
|---|
'cell' |
'columnHeader' |
DisplayFormat is an AdaptableFormat: a NumberFormatter, DateFormatter, or StringFormatter, each with its own Options.
Style
Each Style object is an Adaptable Style which defined as follows:
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).
string
CSS class added to the cell. Colour, font and border properties on this object are still applied.
Display Formats
The DisplayFormat property is of type AdaptableFormat which can be one of 3 objects:
Numeric Format
The numberformatteroptions provides Numeric Display Formats :
NumberFormatterOptions
Formatter Options for Numeric Columns
BaseFormatterOptions
boolean
Returns absolute value of cell value
boolean
Returns smallest integer greater than cell value
string | number
Replaces cell value with supplied value (that can contain Template Literals)
boolean
Show nothing in cell (but underlying value remains)
boolean
Returns largest integer cell value
number
Number of digits to show in Fractions (up to 20)
string
Separator to use in fractions
number
Number of digits to show for Integers (up to 20)
string
Separator to use in Integers
number
Multiplier to use on cell value
'standard' | 'scientific'
Numeric notation to use when rendering the value.
- 'standard' (default) — renders the number normally.
- 'scientific' — renders the number in scientific notation
(e.g. 1.23e+5). When set, IntegerSeparator is ignored
and FractionDigits controls the number of mantissa digits.
boolean
Shows negative numbers in parentheses
string
Prefix to use before cell value
boolean
Rounds cell value
string
Suffix to use after cell value
boolean
Truncates cell value
string
When the numeric value is zero (after multiplier and rounding):
- omitted / undefined, or '0' — use normal formatting (e.g. 0, 0.00)
- '' — show a blank cell (user cleared the default 0 in the wizard)
- any other string — show that text (e.g. -, —)
String Format
The stringformatteroptions provides String Display Formats :
StringFormatterOptions
Formatter Options for String Columns
BaseFormatterOptions
'Upper' | 'Lower' | 'Sentence'
Sets text to Upper, Lower or Sentence case
string
Replaces cell value; useful when using Condition (e.g. replace null with 'N/A')
boolean
Show nothing in cell (but underlying value remains)
string
Prefix to use before the cell text
string
Suffix to use after the cell text
boolean
Trims text (both start and end)
Date Format
The dateformatteroptions provides Date Display Formats :
DateFormatterOptions
Formatter Options for Date Columns - contains a single Pattern property
BaseFormatterOptions
string
Pattern to use for Date Format
Format Column Options
FormatColumnOptions
Provides Custom Formats used in Format Column Module
Custom Formatters to use in Format Column Module
Custom Display Formatters
CustomDisplayFormatter
Defines a Custom Display Format
(customDisplayFormatterContext:CustomDisplayFormatterContext) => any
Function used to render the Custom Display Format
string
Custom Format Id
string
Custom Format Description
Used by Format Columns wizard to show where Custom Display Format can be applied
CustomDisplayFormatterContext
Context used in handler of CustomDisplayFormatter
Format Column API
FormatColumnApi
Format Columns: the display format and style applied to a column, including which formats are active.
Adds a Format Column to Format Column State
Adds Format Columns to Format Column State
Moves a Format Column down so the formats above it are applied first.
void
Deletes all Format Columns in the State
void
Deletes an existing Format Column
Edits the Format Column
Format Columns that match the given criteria.
Retrieves all active (not-suspended) Format Columns in Adaptable State
AdaptableFormat | undefined
Retrieves the first Format Column's Adaptable Format for a given Column
FormatColumn | undefined
Retrieves a Format Column by its Name
Retrieves Format Column by the technical ID (from FormatColumnState)
Retrieves all Format Columns in Adaptable State
Gets all FormatColumns which are defined for the given column
Gets all FormatColumns which are defined for the column with the given columnId
Retrieves Format Column section from Adaptable State
Retrieves all suspended Format Columns in Adaptable State
boolean
Checks if a Format Column contains a Custom Display Formatter
Moves a Format Column up so it is applied before the formats below it.
void
Opens Settings Panel with Format Column section selected and visible
void
Suspends all Format Columns
Suspends an Format column
void
Activates all suspended Format Column
Activates a suspended Format Column.