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

孤人 提交于 2020-02-19 09:47:49

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!