Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to get the current sort column in a jqGrid after user clicks a column header

Tags:

jquery

jqgrid

I'm in the beforeRequest handler, and would like to know what the current sort column is. How can I find that?

like image 338
sprugman Avatar asked Oct 27 '10 20:10

sprugman


1 Answers

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'
like image 117
Oleg Avatar answered Oct 23 '22 23:10

Oleg