问题
I'm in the beforeRequest handler, and would like to know what the current sort column is. How can I find that?
回答1:
You can examine the values of the jqGrid parameters sortname
and sortorder
("desc" or "asc"). To get the parameters you can use getGridParam
method:
var sortColumnName = $("#list").jqGrid('getGridParam','sortname');
and
var sortOrder = $("#list").jqGrid('getGridParam','sortorder'); // 'desc' or 'asc'
来源:https://stackoverflow.com/questions/4037509/how-to-get-the-current-sort-column-in-a-jqgrid-after-user-clicks-a-column-header