Muhammad Haseeb
Muhammad Haseeb

Reputation: 1341

Show cell values for group rows in AgGrid

I am working with Ag-Grid enterprise and using the rowModelType as serverSide I just want to show some custom value for the second and third column on the group row(marked in red line). I have inspected the elements and there seems to be only 1 cell for the group rows which is for Members column in this case. I have also tried to use this example, using the aggFunc but that didnt work either.

My ColumnDefs is following:

[{
    field: 'CALENDARYEAR',
    rowGroup: true,
    hide: true
  },
  {
    field: 'MONTHYEAR',
    rowGroup: true,
    hide: true
  },
  {
    field: 'Members',
    headerName: 'Members',
    width: 300,
  },
  {
    field: 'Column Name',
    headerName: 'Column Name',
    width: 240,
    valueFormatter: () => {
      return 'Date Value';
    },
  },
  {
    field: 'Members',
    headerName: 'Parent',
    width: 240,
    valueFormatter: (params: ValueFormatterParams) => {
      return params.node ? .parent ? .key || 'None';
    },
  },
];

enter image description here

Upvotes: 1

Views: 618

Answers (1)

Muhammad Haseeb
Muhammad Haseeb

Reputation: 1341

I was able to achieve that using the grid property groupDisplayType as singleColumn It create a different cell for each column for the group rows as well. Here is a working example of this: https://plnkr.co/edit/jf8bctV8RmoWoMEh?open=main.js

Upvotes: 3

Related Questions