Display Format using Templates
Summary
- AdapTable enables Display Formats to be created with Template Literals
- These are then dynamically converted using string interpolation
Developers and runtime users can leverage Template Literals when providing a Display Format.
Hint
- Template Literals are supplied as part of the Format Column definition
- They are placed in the
Contentproperty inOptionsproperty ofDisplayFormatobject
When the cell is rendered the Template Literal is evaluated using string interpolation and the derived substitute text is displayed
Note
Template Literals can be used when providing String Display Formats and Number Display Formats
Template Literal Properties
There are 3 Display Format Template Literals available:
| Template Literal | Displays |
|---|---|
[column] | Friendly Name of Formatted Column |
[value] | Non-formatted value for the Cell |
[rowData.x] | Other values in Row (e.g. [rowData.price]) |
Column Formatting: Template Literal Display Formats
- This example shows 2 columns with Display Formats that contain Template Literals:
Namealso contains the value of thelanguagedata value in the rowGitHub Starsadds the word 'Stars' after the value