Skip to content

GridAggregationFunction API

Grid aggregation function definition interface.

Demos

Import

import { GridAggregationFunction } from '@mui/x-data-grid-premium'

Properties

apply

Function that takes the current cell values and generates the aggregated value.

Type:(params: GridAggregationParams<V>) => AV | null | undefined


columnTypesOptional

Column types supported by this aggregation function.
If not defined, all types are supported (in most cases this property should be defined).

Type:string[]


getCellValueOptional

Function that allows to transform the value of the cell passed to the aggregation function applier.
Useful for aggregating data from multiple row fields.

Type:(params: GridAggregationGetCellValueParams) => V


hasCellUnitOptional

Indicates if the aggregated value have the same unit as the cells used to generate it.
It can be used to apply a custom cell renderer only if the aggregated value has the same unit.

Type:boolean

Default:true


labelOptional

Label of the aggregation function.
Will be used to add a label on the footer of the grouping column when this aggregation function is the only one being used.

Type:string

Default:apiRef.current.getLocaleText('aggregationFunctionLabel{capitalize(name)})


valueFormatterOptional

Function that allows to apply a formatter to the aggregated value.
If not defined, the grid will use the formatter of the column.

Type:GridValueFormatter