I want to use the aggregate value in another column (not the grouping column) in grouping header. For example, here is the demo from Kendo:
http://demos.telerik.com/kendo-ui/grid/aggregates
It aggregate the Units On Order for Units In Stock. I want to show the Average 14 in grouping header (besides Count: 5). Is it possible?
I tried to use template in header,
groupHeaderTemplate: "Units In Stock: #=value# (#=getAverage(data)# / #=count#)"
Then in getAverage(), I calculated the value based on data.
var aggregates = ds.aggregates();
var averaged = aggregates.UnitsOnOrder.average;
However, the average is the average of all rows, not the data within the group.
Any suggestions?
Thanks