gpt4 book ai didi

jquery - 表排序过滤器 - 更改重置过滤器值

转载 作者:行者123 更新时间:2023-12-01 04:39:54 25 4
gpt4 key购买 nike

有没有办法将重置过滤器值从空白更改为其他值?即“全部”

从 mottie 看到这个 JSfiddle 使用 data-value,但它所做的是将其设置为默认过滤器值。 http://jsfiddle.net/Mottie/856bzzeL/1005/

<thead>
<tr>
<th class="filter-select">Name</th>
<th>Major</th>
<th data-value="f">Sex</th>
<th>English</th>
<th>Japanese</th>11
<th>Calculus</th>
<th>Geometry</th>
</tr>
</thead>

我需要的是一个重置过滤器值,该值将在选择时显示所有值,就像在具有过滤器选择属性的列上选择空白值一样。

我有办法实现这个目标吗?

谢谢

最佳答案

不要触发 filterReset 方法,而是设置所需的默认过滤器 ( demo ):

$(function() {
var $table = $('#mytable');
$('#reset-link').click(function(e) {
$table.trigger('sortReset', function() {
$.tablesorter.setFilters($table, ['', '', 'f']);
});
return false;
});
$table.tablesorter({
theme: 'blue',
sortList: [[0, 0], [1, 0], [2, 0]],
widgets: ['filter', 'zebra']
});
});

关于jquery - 表排序过滤器 - 更改重置过滤器值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40963443/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com