tablesorter 中是否有一种方法可以过滤到 select 字段为空的行?

Is there a way in tablesorter to filter to select only rows where the field is empty?

当我在 filter_functions 中使用“|Empty”时,没有应用过滤。我希望能够进行过滤,以便显示字段为空的行。

我刚刚更新了 tablesorter fork repository, so with v2.21.5+, you can now add a filter_function to target empty cells, and use the filter_selectSource to populate the select with custom and/or all column cell text as options (demo):

$(function(){
    $('table').tablesorter({
        theme: 'blue',
        widgets: ['zebra', 'filter'],
        widgetOptions: {
            filter_functions: {
                0: {
                    '{empty}' : function (e, n, f, i, $r, c) {
                        return $.trim(e) === '';
                    }
                }
            },
            filter_selectSource: {
                0: function (table, column, onlyAvail) {
                    // get an array of all table cell contents for a table column
                    var array = $.tablesorter.filter.getOptions(table, column, onlyAvail);
                    // include the filter_function option
                    array.push('{empty}');
                    return array;
                }
            }
        }
    });

});