Filter tablesorter外部输入过滤器应用于两列并以输入值开始

Filter tablesorter外部输入过滤器应用于两列并以输入值开始,filter,external,tablesorter,Filter,External,Tablesorter,我正在学习表格分拣机,并试图做一个过滤器的外部输入。它过滤两列(姓名和姓氏)。筛选器必须搜索以输入文本字段内容开头的字符串。他们分开工作 显然,无法使用filter_startsWith:true筛选两个以上的列。如果我把它们放在一起,它将返回一个空集 HTML: 我已尝试删除筛选器。\u startsWith:true with: 在widgetOptions中,它可以从字符串(/^{q}/)的开头搜索名称和姓氏(1&2),但它不起作用 你能给点小费吗 非常感谢看起来有个bug导致了javas

我正在学习表格分拣机,并试图做一个过滤器的外部输入。它过滤两列(姓名和姓氏)。筛选器必须搜索以输入文本字段内容开头的字符串。他们分开工作

显然,无法使用filter_startsWith:true筛选两个以上的列。如果我把它们放在一起,它将返回一个空集

HTML:

我已尝试删除筛选器。\u startsWith:true with:

在widgetOptions中,它可以从字符串(/^{q}/)的开头搜索名称和姓氏(1&2),但它不起作用

你能给点小费吗


非常感谢

看起来有个bug导致了javascript错误。我刚刚修复了它并推出了一个新版本(v2.23.0)。使用此代码:

/* Documentation for this tablesorter FORK can be found at
* http://mottie.github.io/tablesorter/docs/
*/
$(function () {
    $('table').tablesorter({
        theme: 'blue',
        widgets: ['zebra', 'filter'],
        widgetOptions: {
            filter_columnFilters: false,
            filter_startsWith: true,
            filter_external : '#search',
            filter_defaultFilter: {
                // 7 = "any" match filter index (total table columns + 1)
                7 : '{q1} or {q2}'
            }
        }
    });
});

看起来有个bug导致了javascript错误。我刚刚修复了它并推出了一个新版本(v2.23.0)。使用此代码:

/* Documentation for this tablesorter FORK can be found at
* http://mottie.github.io/tablesorter/docs/
*/
$(function () {
    $('table').tablesorter({
        theme: 'blue',
        widgets: ['zebra', 'filter'],
        widgetOptions: {
            filter_columnFilters: false,
            filter_startsWith: true,
            filter_external : '#search',
            filter_defaultFilter: {
                // 7 = "any" match filter index (total table columns + 1)
                7 : '{q1} or {q2}'
            }
        }
    });
});
        filter_defaultFilter :
        {
            1: '/^{q}/',
            2: '/^{q}/'
        },
/* Documentation for this tablesorter FORK can be found at
* http://mottie.github.io/tablesorter/docs/
*/
$(function () {
    $('table').tablesorter({
        theme: 'blue',
        widgets: ['zebra', 'filter'],
        widgetOptions: {
            filter_columnFilters: false,
            filter_startsWith: true,
            filter_external : '#search',
            filter_defaultFilter: {
                // 7 = "any" match filter index (total table columns + 1)
                7 : '{q1} or {q2}'
            }
        }
    });
});