Using AG Grid Cell Rendering
Summary
- AG Grid Value Getters, Value Formatters and Cell Components all work in AdapTable
- Prefer AdapTable Formatting, Styling and Calculated Columns where they cover the same need
AG Grid Rendering Objects
AG Grid provides very powerful functionality to enable custom cell and column content.
This is primarily achieved using 3 objects (depending on the complexity of the use case):
- Value Formatters — format the displayed value (essentially text formatting)
- Cell Components — display anything in a cell
- Value Getters — retrieve the cell value using custom logic
All of these work in AdapTable.
Where they cover the same need, we recommend using AdapTable objects instead:
- Display Formats in place of Value Formatters
- Styling and Styled Columns in place of Cell Components
- Calculated Columns in place of Value Getters
Note
Behind the scenes AdapTable converts its objects to AG Grid Value Formatters and Cell Components
This recommendation is made for a number of reasons, based on extensive user experience, including:
- AdapTable's objects can be changed at run-time via Wizards
- AdapTable's objects are fully saveable in State, and therefore shareable with colleagues
- AdapTable will ensure that they always work if AG Grid's api changes (i.e. they are future-proofed)
Hint
Keep an AG Grid Cell Component when the cell must show something AdapTable cannot author — for example an image, an interactive widget, or a third-party renderer
Note
- Export can write the display value for a column that uses an AG Grid Value Formatter (or an AdapTable Display Format)
- It cannot do that for a column that uses an AG Grid Cell Component — only the raw value is available
AG Grid Cell Rendering & Formatting
- This demo shows how AG Grid Cell Components, Value Formatters and Value Getters work with AdapTable
- The same fields are rendered with AG Grid and AdapTable options side by side:
Madeappears twice, once with an AG Grid Value Formatter and once with an AdapTable Date Display FormatPriceappears twice, once with an AG Grid Value Formatter and once with an AdapTable Numeric Display FormatRatingappears 3 times, once with an AG Grid Value Formatter, once with an AG Grid Cell Component and once with an AdapTable Custom Display FormatCompositeappears twice, once with an AG Grid Value Getter and once using an AdapTable Calculated ColumnModelhas an AdapTable (Badge) Styled Column configured in Initial Adaptable State
Try It Out
- Export
Current Layoutto Excel and compare the display values: Value Formatter and Display Format columns export formatted text; the Cell Component column does not
Loading demo…