Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Disable sorting in jqGrid

Tags:

jqgrid

Is it possible to disable sorting in jqGrid for all columns instead of adding sortable: false to each column in colModel?

like image 582
Joper Avatar asked Aug 22 '11 13:08

Joper


People also ask

How to remove sorting in jqGrid?

To enable or disable the sorting of a Grid column, you can set its sortable property to false. In the code example below, the sorting of the "ShipName" column is disabled. });

How do I sort a column in jqGrid?

The value of sidx parameter will be constructed from sortname option of jqGrid and the value of sord from sortorder . So you should do the following: $('#yourgrid'). jqGrid('setGridParam', {sortname: 'yourColumn', sortorder: 'asc'}).


1 Answers

This functionality was added in jqGrid 4.0+

After defining your colModel section in the jqGrid configuration, add the following:

cmTemplate: {sortable:false},

This will force all columns to no longer be sortable.

like image 91
EssCeeUK Avatar answered Oct 20 '22 00:10

EssCeeUK