Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to disable sorting on column in jQuery.tablesorter?

Tags:

I try to find a way how to disable sorting on column. I use jQuery plugin tablesorter. And by default if you click on header cell it sort column data, but what I need to do if I don't need to use sorting on one or two column in four columns table.

Thanks in advance.

like image 271
Ishikawa Yoshi Avatar asked Jan 20 '12 14:01

Ishikawa Yoshi


2 Answers

You must pass the appropriate parameters at initialization, for example:

{ ...
   headers: { 0: { sorter: false} }
}

For more information, check the manual at:

http://tablesorter.com/docs/

like image 145
xpapad Avatar answered Sep 23 '22 21:09

xpapad


Also you can use html data attribute:

<th data-sorter="false">...</th>

Or you can use a class:

<th class="sorter-false">...</th>
like image 43
imbolc Avatar answered Sep 21 '22 21:09

imbolc