Search code examples
filterexternaltablesorter

Tablesorter external filter only works with small letters


I'm using Tablesorter 2.22.1, everything works fine except an external filter on two columns :

$table.tablesorter({
    theme: 'bootstrap',
    dateFormat: "ddmmyyyy",
    widthFixed : false,
    widgets: ["zebra", "filter"],
    ignoreCase: false,
    widgetOptions : {
        filter_childRows : false,
        filter_childByColumn : false,
        filter_columnFilters : true,
        filter_columnAnyMatch: true,
        filter_cellFilter : '',
        filter_cssFilter : '', // or []
        filter_defaultFilter : {},
        filter_excludeFilter : {},
        filter_external : '',
        filter_filteredRow : 'filtered',
        filter_formatter : {
            // Alphanumeric (exact)
            '.checkSelectBox' : function($cell, indx){
                return $.tablesorter.filterFormatter.select2( $cell, indx, {
                    match : false, // exact match only
                    value : []
                });
            },
        },
        filter_functions : null,
        filter_hideEmpty : true,
        filter_hideFilters : false,
        filter_ignoreCase : true,
        filter_liveSearch : true,
        filter_onlyAvail : 'filter-onlyAvail',
        filter_placeholder : { search : '', select : '' },
        filter_reset : 'button.reset',
        filter_saveFilters : true,
        filter_searchDelay : 300,
        filter_searchFiltered: false,
        filter_selectSource  : null,
        filter_serversideFiltering : false,
        filter_startsWith : false,
        filter_useParsedData : false,
        filter_defaultAttrib : 'data-value',
        filter_selectSourceSeparator : '|'
    }
});
$.tablesorter.filter.bindSearch( $table, $('.search') );

HTML :

<input class="search form-control" style="width: 20%; display: inline;" placeholder="Recherche par titre et détails" data-column="1,2" type="search">

This config works with a filter with only one column in data-column

I don't understand why it does not work. By checking the doc, it seems I have the correct options.


Solution

  • Ideally, the ignoreCase option and filter_ignoreCase option should match - either both true or both false. In the code above, the former is false and the latter is true which is likely the problem you are noticing.