How to get the name/id of the sort column and the sort-order of the column in slickgrid? I'm able to set the sort column using grid.setSortColumn("column"), and would like to get the sort column and it's sort order.
You can access it in the callback function to onSort:
var grid = new Slick.Grid("#sf_grid", dataView, columns, options);
grid.onSort.subscribe(function(e, args) {
var sortdir = args.sortAsc ? 1 : -1; //get the sort order
var sortcol = args.sortCol.field; //get the sort column
});
We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.OkRead more