Is there a way to determine which column the grid is currently sorted on and the direction in which it is sorted? (Aside from using the columnSorting event, which only fires when the user changes the sort?)
Hi,
sure. you can get the column settings which correspond to the columnKey, where columnSettings[x].columnKey = <key of the column you want to check>, then the property currentSortDirection will tell you if it's sorted or not ("asc" or "desc").
var sorting = $("#gridID").data("igGridSorting");
var settings = sorting.columnSettings;
for (i = 0; i < settings.length; i++) {
if (settings[i].currentSortDirection === "asc" || settings[i].currentSortDirection === "desc") {
// it's sorted.
}
Hope it helps. Thanks,
Angel
Great--thanks!