After a lot of searching I found out how to get group-level and grand-total aggregates working.
However, now that is in place, I find that changing the grouping via the GUI blows up.
I guess this makes sense since the aggregation is set as a static object, but this must be a common requirement surely? I want to have group level aggregates and the grand total continue to work even if the user wants different grouping.
I've created a JSFiddle to focus any help people can offer.
I suspect this may involve my catching a grid event but I welcome any suggestion. I can reference an object as the datasource group attribute.
Is this the way to go? To dynamically change "grouping" based on grouping changes?