How to use column groups in Data Grid?
Posted:
Wed Mar 01, 2023 1:34 pm
by swingman
Hi All,
I would like to add some headerGroups in an Data Grid (ag-grid).
There is a property on the column called headerGroup, but I do not know how to use it to get a headerGroup to span several columns...
Re: How to use column groups in Data Grid?
Posted:
Mon Mar 06, 2023 9:59 am
by mboegem
There's a property on the grid, called 'groupUseEntireRow', I guess that's what you are looking for.
Re: How to use column groups in Data Grid?
Posted:
Mon Mar 06, 2023 10:08 am
by swingman
Thanks for replying Marc, maybe I should have shown an example:
If you look at
https://www.ag-grid.com/javascript-data ... mn-groups/there is
- Code: Select all
const gridOptions = {
columnDefs: [
{
headerName: 'Athlete Details',
children: [
{ field: 'athlete' },
{ field: 'age' },
{ field: 'country' },
]
},
{
headerName: 'Sports Results',
children: [
{ field: 'sport' },
{ field: 'total', columnGroupShow: 'closed' },
{ field: 'gold', columnGroupShow: 'open' },
{ field: 'silver', columnGroupShow: 'open' },
{ field: 'bronze', columnGroupShow: 'open' },
]
}
],
// other grid options ...
}
The Servoy component gives the impression that you can set the column groups in properties.
Is that the case?