Skip to content
This repository was archived by the owner on Jun 1, 2025. It is now read-only.

Commit 2e279f0

Browse files
authored
docs: improve formatters doc
1 parent 0ae82df commit 2e279f0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

docs/column-functionalities/Formatters.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
`Formatters` are functions that can be used to change and format certain column(s) in the grid. Please note that it does not alter the input data, it simply changes the styling by formatting the data differently to the screen (what the user visually see).
1818

19-
A good example of a `Formatter` could be a column name `isActive` which is a `boolean` field with input data as `True` or `False`. User would prefer to simply see a checkbox as a visual indication representing the `True` flag, for this behavior you can use `Formatters.checkmark` which will use Material Design icon of `mdi-check` when `True` or an empty string when `False`.
19+
A good example of a `Formatter` could be a column name `isActive` which is a `boolean` field with input data as `True` or `False`. User would prefer to simply see a checkbox as a visual indication representing the `True` flag, for this behavior you can use `Formatters.checkmarkMaterial` which will use Material Design icon of `mdi-check` when `True` or an empty string when `False`.
2020

2121
#### Provided Formatters
2222

@@ -30,7 +30,7 @@ A good example of a `Formatter` could be a column name `isActive` which is a `bo
3030
* `Formatters.arrayObjectToCsv`: Takes an array of complex objects and converts it to a comma delimited string.
3131
* you also need to pass the property name(s) for the complex object, i.e.: `formatter: Formatters.arrayObjectToCsv, params: { propertyNames: ['name'], useFormatterOuputToFilter: true }`
3232
* `Formatters.arrayToCsv` : takes an array of text and returns it as CSV string
33-
* `Formatters.checkmarkMaterial` use Material Design to display a checkmark icon
33+
* `Formatters.checkmarkMaterial` will display a checkmark icon when value is truthy using Material Design icons
3434
* `Formatters.collection`: Looks up values from the columnDefinition.params.collection property and displays the label in CSV or string format
3535
* `Formatters.complexObject`: takes a complex object (with a `field` that has a `.` notation) and pull correct value, there are multiple ways to use it
3636
1. `{ id: 'firstName', field: 'user.firstName', formatter: Formatters.complexObject}`, will display the user's first name

0 commit comments

Comments
 (0)