Tablesorter:在加载时设置初始过滤器选择值 [英] Tablesorter: Set initial filter-select value on load
问题描述
我有一个tablesorter表,其中一列使用过滤器 - 选择
和过滤器唯一
类。
我想要做的是在下拉列表中的某个值上预先过滤该列。
我已经尝试将其设置为数据占位符
属性,但是这并不能解决问题。
我也尝试了以下方法:
$ p $
$(document).ready(function(){
$ .tablesorter.setFilters($(#table ),['','','','','','','','T'],true);
});
正确设置选择菜单中的过滤器,但不会真正运行过滤器。 >
有什么想法?
要初始设置过滤器,一个头 您可以在Age列中看到一个例子,其中 I have a tablesorter table where a column uses the I have tried setting it in the I've also tried the following: It correctly sets the filter in the select menu but doesn't actually RUN the filter. Any ideas? To initially set the filters, add the filter to a header You can see an example here in the Age column where 这篇关于Tablesorter:在加载时设置初始过滤器选择值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!data-value
属性(由
$ p $ p>
< table id =table>
< thead>
< tr>
< th> ...< / th>
...
< th data-value =T> ...< / th>
< / thead>
< tbody>
...
< / tbody>
< / table>
< 30
最初被设置。 / p> filter-select
and filter-onlyAvail
classes.
What I'm trying to do is pre-filter that column on one of the values in the drop-down select.data-placeholder
attribute but that doesn't do the trick.$(document).ready(function(){
$.tablesorter.setFilters($("#table"),['','','','','','','','T'],true);
});
"data-value"
attribute (set by the filter_defaultAttrib
widget option):<table id="table">
<thead>
<tr>
<th>...</th>
...
<th data-value="T">...</th>
</thead>
<tbody>
...
</tbody>
</table>
<30
is initially set.