jquery - 如何在 jQuery 表格排序器中禁用多个标题中的一个标题

标签 jquery css tablesorter

我用过 this table sorter plugin .现在,我必须在 <thead> 中使用多个 header .我只希望一行保持事件状态以进行排序。如果没有该行,我希望其他行的标题被禁用以进行排序。我该怎么做? Here is my fiddle有没有办法像这样通过 css 类禁用一个 header ?

<thead> 
<tr> 
    <th class="sorter-false">Info</th> 
    <th class="sorter-false">Info</th> 
    <th class="sorter-false">Info</th> 
    <th class="sorter-false" colspan="2">Text</th> 
</tr> 
<tr> 
    <th>Last Name</th> 
    <th>First Name</th> 
    <th>Email</th> 
    <th>Due</th> 
    <th>Web Site</th> 
</tr> 
</thead>

最佳答案

您可以将参数添加到表格排序器插件:

 $("#myTable").tablesorter({
    theme: 'blue',
    selectorHeaders: '.sorter-true'
});

fiddle 示例:http://jsfiddle.net/lparcerisa/dcwrh9Lx/1/

关于jquery - 如何在 jQuery 表格排序器中禁用多个标题中的一个标题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25511631/

相关文章:

javascript - 观察 div 何时隐藏或显示

jquery - jQuery 的多列自动完成?

javascript - 表单外的语义 UI 提交表单按钮

html - 我的导航栏粘在页面的右边缘,当它粘在滚动顶部时

javascript - 分页和排序表格时如何获得交替行颜色?

java - 尝试在 Jax-RS Jersey 中发送 FormData() 时的 415 状态

css - 谷歌翻译 CSS 样式西类牙语

html - 如何仅使用 CSS 将图像定位到进度条的值

javascript - Tablesorter:要过滤的外部复选框

javascript 表排序/分页(客户端)。多大算太大?