How to disable sorting for a specific columns in Ag-grid?

Viewed 13378

I am using https://www.ag-grid.com/ in one of my AngularJs projects.My requirement is to disable the sorting on any column while any grouping is happening.

I know we can disable sorting/filtering on single column with below configuration:

colDef.suppressMenu = true
colDef.suppressSorting = true <--- this i can set up while giving column definition

but how to do it dynamically on the specific condition, For more clarification please check the image below enter image description here

In this, I am grouping the grid by country and expanding Ireland country but now I don't to disable sorting on any parameter and enable it again when grouping attribute is removed.

Is there a way to achieve this, Please let me know and if any duplicate question already exists please add that in the comment section.

Thanks

3 Answers
Related