Value Getters
A valueGetter computes a cell's value from the whole row (and grid context), instead of reading a single field. Sorting, filtering and export then all operate on the computed value, which keeps derived logic in one place.
Planned. This page shows the specification from issue #179. The live example, source for every framework and the API reference replace it when the feature ships.
Live example
Order rows with qty, unitPrice and discount. A Total column uses a valueGetter.
Expected behavior
Total displays the computed value and sorts numerically. Changing qty updates Total on refresh. Changing the tax rate in the context recomputes all Totals.
Planned API surface
columnDef.valueGetterValueGetterParams (data, node, colDef, getValue, context)api.getCellValueAcceptance criteria
- The valueGetter result is used for display, sort, filter and export (pending)
- getValue(colId) inside a getter returns another column's value (pending)
- A getter is invoked only for rendered cells, or when sort or filter needs the value (pending)
- Changing the context followed by refreshCells recomputes the values (pending)