Search code examples
tablesorter

TableSorter filter - remove all rows with a given keyword


I am displaying a table with tablesorter that has column filtering and would like to add a button that would remove all rows in which the word "error" appears in a certain column. I managed to create a button that would essentially just throw

!error 

to the filter but I would prefer that it leaves the filter field open so that one can still use it and retain the removal of the error rows.

I tried the method from TableSorter - External Search, Trying to search from button to filter all, not just column but while it can find all the columns with "error", putting "!error" doesn't work since even a row that contains "error" also has columns that don't contain it. Anyone know of a way to hide those rows while still retaining the filtering ability on the remaining rows?


Solution

  • A not (!) query applied to all columns was previously ignored; but tablesorter v2.26.2 was just released and it now allows those type of search queries.

    Try this demo - click on the !aaron button to test it.