JeanAlesi
JeanAlesi

Reputation: 598

Conditional row grouping Ag-Grid

Is there a way to enable row grouping, but only group rows when there are more than one values to be grouped. I want to avoid having groups of only a single row. I don't think it makes sense to group those

Upvotes: 0

Views: 3233

Answers (2)

chety
chety

Reputation: 156

Let's say you want to group State column of your data. But some of your row's State column value may not be exist/null. So you do not want to group these kind of rows. To achieve this traverse your data source and assign State column value to null or undefined. If you do this rows that have column value as null or undefined will not be grouped.

https://www.ag-grid.com/javascript-grid-grouping/#unbalanced-groups

Upvotes: 1

JeanAlesi
JeanAlesi

Reputation: 598

The way to remove single children is by setting removeSingleChildren=true

https://www.ag-grid.com/javascript-grid-grouping/

Upvotes: 0

Related Questions