API REFERENCE
valueGetter
Returns a cell value calculated from the source row. Use valueFormatter for display-text changes only.
What does this API do?
Returns a cell value calculated from the source row. Use valueFormatter for display-text changes only.
Exact input and result types
valueGetter?: GridCallback<[ValueGetterParams<TData, TValue, TContext>], TValue> | string| Item | Value |
|---|---|
| Required | Optional |
| Input type | GridCallback<[ValueGetterParams<TData, TValue, TContext>], TValue> | string |
Usage flow
Set this on an individual column object in columnDefs. Pass arrays, objects, and callbacks through JavaScript, and use new arrays or objects when applying changes.
Read related types
Feature explanations and examples
- Separate calculation and display
valueGetter produces a calculated value, while valueFormatter produces readable display text. Return numbers from getters when totals, sorting, or comparisons require numeric values.