Aggregate(sum) async data

1 Answer 644 Views
Grid
Stavros
Top achievements
Rank 1
Iron
Stavros asked on 15 Oct 2021, 03:27 PM

Hello guys!

Is it possible to aggregate (sum) some columns inside an extra last row (footer) with a grid that gets data from an async source?

Here is a sample of my code :


<kendo-grid [data]="gridData$ | async" (cellClick)="onCellClick($event)" [rowClass]="rowCallback">
                <kendo-grid-column


public gridData$ = this.service.cdiVariable$.pipe(
    tap(console.log),
    switchMap(cdiVariable =>
      this.dataSource.getContracts(cdiVariable).pipe(
        catchError(error => {
          if (error.error instanceof ErrorEvent) {
            this.errorMsg = `Error: ${error.error.message}`;
          } else {
            this.errorMsg = `Error: ${error.message}`;
          }
          return of([]);
        })
      )
    ),
    tap(console.log)
  );

1 Answer, 1 is accepted

Sort by
0
Dimiter Topalov
Telerik team
answered on 20 Oct 2021, 06:51 AM

Hi Stavros,

The built-in Grid aggregates functionality can be used regardless of the mechanics of obtaining the Grid data, as described in the following section of our documentation:

https://www.telerik.com/kendo-angular-ui-develop/components/grid/grouping/aggregates/

Furthermore, any additional and/or custom calculated values, aggregates, etc., can be displayed in the Grid footer and group footer templates (if needed) as the developer see fit.

I hope this helps.

Regards,
Dimiter Topalov
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Tags
Grid
Asked by
Stavros
Top achievements
Rank 1
Iron
Answers by
Dimiter Topalov
Telerik team
Share this question
or