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

Update Grand Total when using ServerAggregates and PushUpdate

1 Answer 29 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Christiaan
Top achievements
Rank 1
Christiaan asked on 20 Jun 2020, 07:36 PM

You can find an example of the issue in this jsFiddle https://jsfiddle.net/ewaldhofman/hjkxcr45/1/

In the example, I have a simple datasource which gets local data, but uses ServerAggregates to show the issue that I am running into. The issue is that I can't figure out how to update the grandtotal (footerTemplate) when using pushUpdate.

I use pushUpdate to improve the performance of updating the grid, and everything works (including group totals - which I have enabled in my environment, although not available in the sample) except for the grand total.

I have tried to call the grid.refresh() and the dataSource.read(), but nothing seems to work. 

1 Answer, 1 is accepted

Sort by
0
Accepted
Silviya Stoyanova
Telerik team
answered on 23 Jun 2020, 04:11 PM

Hello Christiaan,

Thank you for the provided example!

When pushUpdate method is used you will need manually to mark the updated items as "dirty".

It is also required to call a dataSource method that will request the remote service and update the data. The last could be achieved by using the dataSource sync method. As the documentation states, it works if the transport.update option is set.

The role of the update action is to notify the server of the new values. Then the server could calculate and return a new aggregate result.

You will find the full implementation demonstrated in the following Dojo example: https://dojo.telerik.com/@bubblemaster/eNihOWix/2

Let me know if you have further questions.

Kind Regards,
Silviya Stoyanova
Progress Telerik

Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.
Tags
Grid
Asked by
Christiaan
Top achievements
Rank 1
Answers by
Silviya Stoyanova
Telerik team
Share this question
or