在Tablesorter中进行预过滤 [英] Pre-filter in Tablesorter

查看:77
本文介绍了在Tablesorter中进行预过滤的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何将非交互式默认过滤器应用于Tablefilter?

How can I apply a non interactive default filter to Tablefilter?

类似show rows where field_1="variable"的东西,但是在加载表时默认为稳定状态.

Something like show rows where field_1="variable" but stablished by default when the table is loaded.

谢谢!

推荐答案

如果我理解您的要求,则可以将标头类设置为"filter-false"以禁用该列中的过滤器.然后在表设置所需的过滤器 .github.io/tablesorter/docs/#initialized"rel =" nofollow>初始化(演示):

If I understand what you are asking, you can set the header class to "filter-false" to disable the filter in that column; then set the desired filters after the table initializes (demo):

$('table').tablesorter({
    theme: 'blackice',
    widgets: ['zebra', 'filter'],
    initialized: function (table) {
        $.tablesorter.setFilters( table, ['abc'], true);
    }
});

这篇关于在Tablesorter中进行预过滤的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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