jQuery:tablesorter插件,禁用某些列的排序 [英] jQuery: tablesorter plugin, disabling sorting on some columns

查看:78
本文介绍了jQuery:tablesorter插件,禁用某些列的排序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正尝试在我的3 col表中禁用对一列的排序.在文档之后,我想到了这一点:

I'm trying to disable sorting of one column in my 3 col table. Following the docs I came up with this:

   $('table.sortable').tablesorter( 
     {sortList: [[0,0], [0,0], [0,0]], textExtraction: myTextExtraction}, 
     {headers: {0:{sorter:true}, 1:{sorter:true}, 2:{sorter:false}}}
   );

官方文档此处

推荐答案

我认为您的代码几乎是正确的.您的textExtraction选项必须使用其自己的{},并且您无需指定默认的标头选项.试试这个:

I think your code is almost correct. Your textExtraction option needs to be in its own {}, and you don't need to specify the default header options. Try this:

$('table.sortable').tablesorter( 
    { sortList: [[0,0], [0,0], [0,0]] }, 
    { textExtraction: myTextExtraction}, 
    { headers: { 2:{sorter:false} } }
);

这篇关于jQuery:tablesorter插件,禁用某些列的排序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆