How do I get the list of columns on which sorting is applied, in ag-grid. There is an api (onSortChanged) and an event (sortChanged). But neither is helpful in this scenario.
You can use gridApi.getSortModel()
, which returns you an array containing all column Ids and sort direction like below.
[
{colId: "country", sort: "asc"},
{colId: "athlete", sort: "asc"}
]