New to KendoReactStart a free 30-day trial

Aggregate

Interface

Represents the PivotGrid aggregate object. Applicable for local data binding.

Definition

Package:@progress/kendo-react-pivotgrid

Syntax:

ts
const sumAggregate: Aggregate = {
    init: (data) => { data.sum = ('sum' in data) ? data.sum : 0; },
    accumulate: (data, value) => { data.sum += value; },
    merge: (src, dest) => { dest.sum += src.sum; },
    result: data => data.sum,
    format: (value: number) => value.toFixed(2)
};

Properties

accumulate

(data: any, value: any) => void

The accumulate function will be called for every value that needs to be aggregated.

Parameters:dataany

The aggregated data so far.

valueany

The value that needs be aggregated in data object.

The format function will be called when the value returned from the result function needs to be formatted.

Parameters:valueany

The aggregated value.

Returns:

string

init

(data: any) => void

The init function initializes the variable where the aggregated data will be stored and returns it in the passed data object. The init function will be called every time before calling accumulate and merge functions.

Parameters:dataany

The data object where the aggregated data will be stored.

merge

(src: any, dest: any) => void

The merge function will be called when two aggregated data objects needs to be merged into one.

Parameters:srcany

The source aggregated data object.

destany

The destination aggregated data object.

The result function will be called when the aggregated value needs to be extracted from the data object.

Parameters:dataany

The aggregated data object.

Returns:

any

In this article
DefinitionPropertiesaccumulateformatinitmergeresult
Not finding the help you need?
Contact Support