Custom Display Format
Summary
- Custom Display Formats can be provided when those provided by AdapTable are insufficient
The Display Format options provided by AdapTable fit the vast majority of real-life use cases.
However, if required, Developers can supply bespoke Custom Display Formatters at design time.
This is done via a 2-stage process:
- Defining the Custom Formatter in
customDisplayFormattersproperty in Format Column Options - Referencing the Custom Formatter in Format Column Initial State
customDisplayFormatters
Custom Formatters used in Format Column Module
Hint
- Only use these when AdapTable's System Display Formats are insufficient for your use case
- You might also find that a Template Display Format provides what you require with less complexity
Each definition includes a handler function which AdapTable invokes when the cell is rendered and which should return the custom display format.
Caution
- The
scopeproperty in the Custom Formatter tells AdapTable which columns in the UI Wizard should offer the option - The actual wiring up is done using the
Scopepropery in the relevant Format Column Definition
Column Formatting: Custom Formatter
- This example provides 4 Custom Display Formats - using the
CustomDisplayFormatterContextobject for evaluation:- for
Licensecolumn where the word 'License' is removed - for
Createdcolumn where we just show the Day of the Week - for
Issue Changecolumn where we replace 0 values with a '-' - for
Gitub Starscolumn where values over one million display M, over one thousand display 'K', or display normally
- for
- Note: We still also use some of the display formats shipped by AdapTable (i.e.
Licenceis UPPER CASE andCreatedis italicised)