Grid recalculates aggregates on page change

3 posts, 0 answers
  1. Max
    Max avatar
    6 posts
    Member since:
    Dec 2015

    Posted 05 Apr 2016 Link to this post

    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. Rosen
    Admin
    Rosen avatar
    3253 posts

    Posted 08 Apr 2016 Link to this post

    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!
     
  3. Max
    Max avatar
    6 posts
    Member since:
    Dec 2015

    Posted 08 Apr 2016 in reply to Rosen Link to this post

    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!

Back to Top