Reputation: 27348
I have following data:
[{ 'Year': 2016, Month: 'January, 'Other columns...' },
{ 'Year': 2016, Month: 'February, 'Other columns...' }]
And I want it to be grouped by year. However, I don't want separate column for Month, when group is expanded, but rather reuse the group column like this:
I guess autoGroupColumnDef
is what I need and I achieved almost what I want:
gridOptions: GridOptions = {
suppressAggFuncInHeader: true,
autoGroupColumnDef: {field: 'Month', headerName: '', cellRendererParams: { suppressCount: true}},
groupIncludeTotalFooter: true,
};
columnDefs: ColDef[] = [
{field: 'Year', hide: true, rowGroup: true },
{field: 'Other Column1', aggFunc: 'sum'},
{field: 'Other Column2', aggFunc: 'sum'},
];
However, the Month values are still aligned right to the year, not under it.
Upvotes: 0
Views: 3130
Reputation: 11570
This can be achieved easily by CSS.
.ag-theme-balham .ag-ltr .ag-row-group-leaf-indent {
margin-left: 0 !important;
}
Have a look at the link: StackBlitz
Upvotes: 1