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:
| Property | Description |
|---|---|
| FormatColumns | Collection 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:
| Property | Description | Default |
|---|---|---|
| ColumnGroupScope | When to format Columns in Column Groups ('Expanded', 'Collapsed', 'Both') | |
| DisplayFormat | Display Format to apply to Column can be Numeric, String or Date | |
| Name | Name of the Format Column definition | |
| RowScope | Which types of Rows to apply format (data, grouped, summary, total) | |
| Rule | Rule to decide whether to apply Format; if undefined Format is always applied | |
| Scope | Where Format will be applied: whole Row, some Columns, or Columns of DataType | |
| Style | AdapTable Style to apply | |
| Target | Where in Column to apply Format (cell or columnHeader) | 'cell' |
| IsReadOnly | Sets Entity to ReadOnly (overwriting a Strategy Entitlement of 'Full') | |
| IsSuspended | Suspends (i.e. turns off) an Adaptable Object |
Style
Each Style object is an Adaptable Style which defined as follows:
| Property | Description |
|---|---|
| Alignment | Align to Left, Right or Center |
| BackColor | Colour background of cell: hex, rgb(a) or name |
| BorderColor | Colour of cell border: hex, rgb(a) or name |
| BorderRadius | Rounds corners of an element's outer border edge; equivalent of CSS border-radius |
| ClassName | Existing CSS Class; use instead of setting other object properties |
| FontSize | Size of font: XSmall, Small, Medium, Large or XLarge |
| FontStyle | Style of font: Normal or Italic |
| FontWeight | Weight of font: Normal or Bold |
| ForeColor | Font colour in cell: hex, rgb(a) or name |
| TextDecoration | Decoration 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 :
| Property | Description |
|---|---|
| Abs | Returns absolute value of cell value |
| Ceiling | Returns smallest integer greater than cell value |
| Content | Replaces cell value with supplied value (that can contain Template Literals) |
| Empty | Show nothing in cell (but underlying value remains) |
| Floor | Returns largest integer cell value |
| FractionDigits | Number of digits to show in Fractions (up to 20) |
| FractionSeparator | Separator to use in fractions |
| IntegerDigits | Number of digits to show for Integers (up to 20) |
| IntegerSeparator | Separator to use in Integers |
| Multiplier | Multiplier to use on cell value |
| Parentheses | Shows negative numbers in parentheses |
| Prefix | Prefix to use before cell value |
| Round | Rounds cell value |
| Suffix | Suffix to use after cell value |
| Truncate | Truncates cell value |
String Format
The stringformatteroptions provides String Display Formats :
| Property | Description |
|---|---|
| Case | Sets text to Upper or Lower case |
| Content | Replaces cell value; useful when using Condition (e.g. replace null with 'N/A') |
| Empty | Show nothing in cell (but underlying value remains) |
| Prefix | Prefix to use before the cell text |
| Suffix | Suffix to use after the cell text |
| Trim | Trims text (both start and end) |
Date Format
The dateformatteroptions provides Date Display Formats :
| Property | Description |
|---|---|
| Pattern | Pattern to use for Date Format |
Format Column Options
The Format Column Options section of Adaptable Options is used to provide Custom Display Formats:
| Property | Description |
|---|---|
| customDisplayFormatters | Custom 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:
| Method | Description |
|---|---|
| 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 |