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

typescript
registerAggFunc(name: string, fn: (values: unknown[], rows: readonly unknown[]) => unknown): Promise<void>
ArgumentsRequiredType
nameRequiredstring
fnRequired(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