API REFERENCE
registerAggFunc
Registers a named custom aggregate function. Use unique names because an existing function with the same name can be replaced.
What does this API do?
Registers a named custom aggregate function. Use unique names because an existing function with the same name can be replaced.
API for Pro features: Row grouping, built-in aggregation and group totals
Exact input and result types
registerAggFunc(name: string, fn: (values: unknown[], rows: readonly unknown[]) => unknown): Promise<void>| Arguments | Required | Type |
|---|---|---|
| name | Required | string |
| fn | Required | (values: unknown[], rows: readonly unknown[]) => unknown |
The return type is Promise<void>.
Usage flow
After registering and initializing the Grid element, call grid.registerAggFunc(…). Read the return value with await. For methods returning a boolean or report, inspect the result before continuing.
Feature explanations and examples
- Grouping and aggregation
Row grouping collects source rows with the same region or team into expandable groups. Unlike column groups, which organize headers, row groups change displayed rows and aggregation results.