When grouping, ng-grid creates group row(s) that look and behave differently to regular rows. In particular, group rows don't display regular columns, but display a single merged row as defined by the aggregateTemplate. What I'm attempting to do is to customize group rows to include aggregated column data. For example:
Columns:
NAME | VALUE
Data:
name1 | 5
name1 | 5
name2 | 1
Grid displayed when grouped by NAME:
- name1 | 10 (this is the first group row expanded)
-- name1 | 5 (these are the actual data rows)
-- name1 | 5 (these are the actual data rows)
- name2 | 1 (this is the second group row collapsed)
Notice that the group rows display both columns and their VALUE is equal to the sum of their children.
If you are familiar with ms excel pivot tables, that's exactly the grouping type functionality I'm trying to emulate.
A similar question here on stack overflow (How to set aggregation with grouping in ng-grid) shows an example of how to do the child aggregation calculations, but I'm stuck on how to get ng-grid to display the output like regular rows with separate columns. Looking at the ng-grid code it's not looking like an easy task. Anyone have some experience with this?
Thanks!