Search code examples
jquerytablesorter

Pre-filter in Tablesorter


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

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

Thanks!


Solution

  • 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);
        }
    });