I'm trying to understand how grouping and aggregates work with the slick grid. I have some data that I want to group in a tree like structure somewhat how it's done on this examples page:
http://mleibman.github.io/SlickGrid/examples/example-grouping
However, I can't find any documentation on setGrouping or on what exactly aggregates are. This page doesn't have any documentation, just code, no useful comments on what the code is for or how it's used.
Does anyone know a good resource for this? Google isn't giving me much info either.
For instance, in this code:
dataView.setGrouping({
getter: "duration",
formatter: function (g) {
return "Duration: " + g.value + " <span style='color:green'>(" + g.count + " items)</span>";
},
aggregators: [
new Slick.Data.Aggregators.Avg("percentComplete"),
new Slick.Data.Aggregators.Sum("cost")
],
aggregateCollapsed: false
});
I get what the getter and formatter are used for, but what are the aggregators used for? Is this what actually groups them together in the tree view? I don't see where percentComplete and cost come into play because it's grouping by duration.