Tablesorter结合sortList和禁用列 [英] Tablesorter combining sortList with disabled columns

查看:141
本文介绍了Tablesorter结合sortList和禁用列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我确定这是一个简单的答案,但作为菜鸟,我没看到它.我只希望一个表在排序时禁用第0列和第2列,然后将默认排序列在第1列.两个单独的命令,但是虽然它们分别工作,但它们似乎相互冲突. 我可以禁用第0列和第2列,并且表格可以完美运行.或者,我可以将我的初始排序设置为第2列,并且表格可以正常运行.但是,当我将其余的可排序列放在一起时,只允许单击一下,就无法切换它们的升序,降序.

I feel sure this is a simple answer but as a rookie I'm failing to see it. I just want a table to have column 0 and 2 disabled from the sort, then the default sort to be column 1. Two separate commands, but while they work individually they seem to clash together. I can have my columns 0 and 2 disabled and the table works perfectly. Or I can have my initial sort set to column 2 and the table works perfectly. But when put together my remaining sortable columns will only allow one click, they cannot be toggled acending, descending.

任何人都可以提供帮助,因为我无法弄清自己在做什么错?预先谢谢你!

Can anyone help, as I just can't figure out what I'm doing wrong? Thank you in advance!

推荐答案

尝试以下演示:

$('table').tablesorter({

    sortList : [[ 1, 0 ]],
    headers : {
        0 : { sorter: false },
        2 : { sorter: false }
    }

});​

这篇关于Tablesorter结合sortList和禁用列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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