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

Cannot see aggregates in grid

4 Answers 81 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Ewald
Top achievements
Rank 1
Ewald asked on 13 Jan 2014, 06:32 AM
I try to add aggregates to the grid. I see a row at the bottom of the grid, but there are no values.

JSFiddle: http://jsfiddle.net/ewaldhofman/49TxH/

What am I doing wrong?

4 Answers, 1 is accepted

Sort by
0
Accepted
Alexander Popov
Telerik team
answered on 13 Jan 2014, 01:11 PM
Hello Ewald,

Since you are using grouped data I assume that you would like to display the group aggregates. In order to do so you have to:
  1. Specify the group.aggregates option
  2. Use the column.groupFooterTemplate to specify what to be shown in the footer

You can find an updated version of your example here.

Regards,
Alexander Popov
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Ewald
Top achievements
Rank 1
answered on 14 Jan 2014, 05:05 AM
Thanks for your response.

You were right that I wanted to see the group totals, but in addition I would like to add the grand total as well. Is that possible?

I don't understand why you put the value "data.Facility.sum" in the groupFooterTemplate. In all the examples it is always just sum. And in the example I used local data, but in reality I use the remote data source (see below snippet). Does that make a difference?


                transport: {
                    read: options=> {
                        $.ajax({...}).done(result=> {
                                options.success(result);
                            }
                        );


0
Accepted
Alexander Popov
Telerik team
answered on 14 Jan 2014, 12:02 PM
Hello again Ewald,

Yes, displaying the total sum is possible. That would require adding a proper aggregate to the DataSource and using a footerTemplate, as shown in this updated example.
Using the "data.Facility.sum" reference yields the same result as just "sum" (unless useWithBlock is disabled), however the latter gives out more information on first glance, so which one you would use is a matter of personal preference. Regarding your last question - no, using remote data would not make any difference.

Regards,
Alexander Popov
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Ewald
Top achievements
Rank 1
answered on 15 Jan 2014, 05:45 AM
Thanks for these detailed responses. I have been able to successfully implement it in my scenario.
Tags
Grid
Asked by
Ewald
Top achievements
Rank 1
Answers by
Alexander Popov
Telerik team
Ewald
Top achievements
Rank 1
Share this question
or