• What is KendoReact
  • Getting Started
  • Server Components
  • Components
    • Animation
    • Barcodes
    • Buttons
    • Chartsupdated
    • Common Utilities
    • Conversational UIupdated
    • Data Gridupdated
    • Data Query
    • Data Tools
    • Date Inputs
    • Date Math
    • Dialogs
    • Drawing
    • Dropdownsupdated
    • Editor
    • Excel Export
    • File Saver
    • Formupdated
    • Ganttupdated
    • Gauges
    • Indicators
    • Inputsupdated
    • Labels
    • Layoutupdated
    • ListBox
    • ListView
    • Map
    • Notification
    • OrgChartnew
    • PDF Processing
    • PDFViewer
    • PivotGrid
    • Popup
    • Progress Bars
    • Ripple
    • Scheduler
    • ScrollView
    • Sortable
    • Spreadsheetupdated
    • TaskBoard
    • Tooltips
    • TreeList
    • TreeViewupdated
    • Upload
  • Sample Applications
  • Styling & Themes
  • Common Features
  • Project Setup
  • Knowledge Base
  • Changelog
  • Updates
  • Troubleshooting

Aggregate

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

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)
};
NameTypeDefaultDescription

accumulate

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

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

format

(value: any) => string

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

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.

merge

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

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

result

(data: any) => any

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

In this article

Not finding the help you need?