This is a migrated thread and some comments may be shown as answers.

Grid recalculates aggregates on page change

2 Answers 49 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Max
Top achievements
Rank 1
Max asked on 06 Apr 2016, 03:26 AM

Hello,

my name is Max and we are strongly using Kendo solutions in our company (and we really appreciate the work you guys have done!).

Anyway, I probably need an explanation - I'm using Kendo Grid with a different dynamic groups, and this Grid has aggregate both for the groups, subgroups and for the whole grid itself.

I managed to show the dynamic aggregations based on user selection from the list of aggregate function, but I noticed that Grid somewhy recalculates all (or some) of them on page change. Maybe it's an expected behavior, then the question is - is it possible to disable that?

The problem is that currently I'm using 30K rows with 30 columns Grid and they will be really bigger, so recalculation takes some visible time (like 1s).

Thanks in advance!

2 Answers, 1 is accepted

Sort by
0
Rosen
Telerik team
answered on 08 Apr 2016, 07:43 AM

Hello Max,

Indeed, the way DataSource work is to apply its current state (paging, grouping, sorting, filtering, aggregates) when this state is changed either by changing the page, group, sort etc. or fetching new data This means that all of the aggregates will be recalculated when such event occur. And unfortunately, there is no way to prevent this behavior. 

A possible way to workaround this will be to manually calculate the aggregates and just us the appropriate footer template to display them inside the Grid instead of relaying to DataSource to do the calculation. 

Regards,
Rosen
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Max
Top achievements
Rank 1
answered on 08 Apr 2016, 08:28 AM

Hello Rosen,

 

thanks for your answer!

 

I understand this behavior, especially when the Data Grid is grouped - you need to recalculate group-specific aggregations on each pages. I just noticed that aggregates for the whole grid are being recalculated also, which sometimes makes sense too (if the data changed).

 

Thanks for the solution, that's the one I wanted to implement myself, but Kendo already did everything (especially with multi-grouping aggregations), so I'd prefer to not to reinvent the wheel :)

 

Thank you again!

Tags
Grid
Asked by
Max
Top achievements
Rank 1
Answers by
Rosen
Telerik team
Max
Top achievements
Rank 1
Share this question
or