I found this solution to be very helpful, however it only works for me if you are using a single column to group by.
My problem is that I have a grid that allows the user to select multiple columns to group by. There is a lot of data behind this grid, and it doesn't fit on any single page, so without using the example above, the users would only see (at the end of a 4 column grouping) 4 lines of: Total W: 100 / Total X:1000 / Total Y:10,000 / Total Z: 100,000. It's nice to be about to know what the totals are for. I think its odd that the Kendo grid can't display this, even thought it is available in the header of the group.
The attached images show: 1) what you see without using the code.. .just line after line of 'Totals', with no description. 2) what you see using the code above with 1 grouping - looks great! and 3) what you see if you group on 2 items.
What appears to happen, is that even though you are grouping now on 2 items, there is really only 1 grouping column (should be 2), and all the contents of the grid get shifted to the left, leaving and empty column on the right. I have an idea that there are basically 2 tiers now in the aggregate, and I am overwriting it with a single grouping, and the grid header is expecting (cols+2) columns, but is only getting (cols+1) of data. Now in writing this post up I just did discover that using this code is putting the grid in some error state that leaves it unresponsive, which I plan on debugging next.
I've tried to stringify the aggregate object to see if there was a way that I could pull out the correct grouping name for the different groups, but nothing is standing out as useful information.
Does anyone have any sample code or information on the aggregates object that might point me in the direction to working with a more complex grouping that 1 column?