1
votes

I am grouping (and aggregating) on a column. Using the example on the ag-grid site, let's say it's Country. I am using these options:

groupUseEntireRow: true,
groupHideGroupColumns: true

and when I define the Country column in the columnDefs I add: rowGroupIndex: 0

But when the grid loads, the Country groupings do not show in alphabetical order by default. How can I get them to sort? I didn't see anything in the documentation that explains this.

Note that I do NOT need to allow the user to sort Country later, I just want to order by Country when the grid loads.

1
You can disable the sorting with suppressSorting and yet use the sort attribute to fix the sort of the column. Note : group sorting just came out with 3.3.0 from 08th February 2016 ag-grid.com/angular-grid-column-definitions/index.php - Walfrat
Thanks. I saw the code at the bottom of the page and that fixed it! - Mark Salamon
@Walfrat put it as an answer so it can get accepted, it's kinda tricky that the answer is here in comments ;) - tfrascaroli

1 Answers

1
votes

Putting my comment as an answer so the author can accept it :

You can disable the sorting with suppressSorting and yet use the sort attribute to fix the sort of the column.

Note : group sorting just came out with 3.3.0 from 08th February 2016 ag-grid.com/angular-grid-column-definitions/index.php