开发者

jQuery tablesorter disable last header

I am using tablesorter for my tables, and now I want that always the last header is disabled from sorting.

I have tried this:

 $(".so开发者_StackOverflow社区rter")
 .tablesorter({widgets: ['zebra'], headers:{0:{sorter:false}, -1:{sorter:false}}})          
 .tablesorterPager({container: $("#pager"), positionFixed: false, size : 5 });

But that does not work... does someone know a solution?


It is not a valid config to specify -1, try this

var $sorterTable = $(".sorter");

var tablesorterConfig = { widgets: ['zebra'], headers:{ 0:{sorter:false} } };

tablesorterConfig.headers[$sorterTable.find("thead th").length - 1] = { sorter:false };


$sorterTable
.tablesorter(tablesorterConfig)          
.tablesorterPager({container: $("#pager"), positionFixed: false, size : 5 });
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜