我从http://mottie.github.com/tablesorter/docs/example-options-headers.html得到了这段代码
// BONUS TIP: disable a column using jQuery data directly
// but do it before the table initializes
$("table thead th:eq(5)").data("sorter", false);
这是可行的,我可以添加第二行来禁用过滤,如下所示。但是,我想将它们合并到一行中。我该怎么做呢?
// I Want to combine this into the prev line
$("table thead th:eq(5)").data("filter", false);
发布于 2013-03-23 06:25:33
完全未经测试的,但请尝试以下代码
$("table thead th:eq(5), table thead th:eq(7)").data("sorter", false).data("filter", false);
发布于 2013-03-24 02:32:46
我想补充的是,您可以组合jQuery data
函数:
$("table thead th:eq(5), table thead th:eq(7)").data({
sorter: false,
filter: false
});
发布于 2016-07-22 21:36:00
要对表单元格禁用排序,请在页眉中添加类
class="sorter-false"
或者你可以在你的“表排序”初始化中添加参数:
headers : { 0 : { sorter: false } }
在初始化过程中禁用过滤器添加参数
headers: { 0: { filter: false} }
DOM (Header)元素,如从0开始的数组
示例
$(".someclass").tablesorter({
widgets : [ "filter" ],
headers: { 0: {filter: false},
1: {sorter: false, filter: false},
2: {sorter: false}
}
});
https://stackoverflow.com/questions/15580617
复制相似问题