<li>When a default filter select is added to a column, it is now parsed from the assigned parser, then sorted using the <code>textSorter</code> setting, and falls back to an alphanumeric sort (<spanclass="version updated">v2.16.3</span>).</li>
<li>The <code>filter_anyMatch</code> widget option was completely <spanclass="label alert">removed</span>. Sorry for not deprecating this option, but the filter any match code was completely rewritten.</li>
<li>Added a <code>filter_external</code> widget option to only accept a jQuery selector string/object; please see the updated <ahref="example-widget-filter-any-match.html">filter any match</a> demo for more details.</li>
<li>Added & set <code>filter_saveFilters</code> to <code>true</code> (default is <code>false</code>) in this demo (<spanclass="version">v2.14</span>).</li>
<li>Hover over the grey bar below the table header to open the filter row. Disable this by setting <code>filter_hideFilters</code> option to <code>false</code>.</li>
<li>This widget uses jQuery's <code>.nextUntil()</code> function which is only available is jQuery version 1.4+.</li>
<li>This widget does work with tablesorter v2.0.5.</li>
<tr><tdclass="center">text</td><td>Any text entered in the filter will <strong>match</strong> text found within the column</td><td><code>abc</code> (finds "abc", "abcd", "abcde", etc); <buttondata-filter-column="1">Aaron</button> (finds "Aaron" and "Philip Aaron Wong")</td></tr>
<tr><tdclass="center"><code>~</code></td><td>Perform a fuzzy search (matches sequential characters) by adding a tilde to the beginning of the query (<spanclass="version">v2.13.3</span>)</td><td><buttondata-filter-column="1">~bee</button> (matches "Bruce Lee" and "Brenda Dexter") or <buttondata-filter-column="1">~piano</button> (matches "Philip Aaron Wong")</td></tr>
<tr><tdclass="center"><code>"</code></td><td>To exactly match the search query, add a quote, apostrophe or equal sign to the beginning and/or end of the query</td><td><code>abc"</code> or <code>abc=</code> (exactly match "abc"); <buttondata-filter-column="1">John"</button> or <buttondata-filter-column="1">John=</button> (exactly match "John")</td></tr>
<tr><tdclass="center"><code>?</code></td><td>Wildcard for a single, non-space character.</td><td><code>J?n</code> (finds "Jan" and "Jun", but not "Joan"); <buttondata-filter-column="2">a?s</button> (finds "Dumass" and "Evans", but not "McMasters")</td></tr>
<tr><tdclass="center"><code>*</code></td><td>Wildcard for zero or more non-space characters.</td><td><code>B*k</code> (matches "Black" and "Book"); <buttondata-filter-column="2">a*s</button> (matches "Dumass", "Evans" and "McMasters")</td></tr>
<tr><tdclass="center"><code>/\d/</code></td><td>Add any regex to the query to use in the query</td><td><code>/b[aeiou]g/i</code> (finds "bag", "beg", "BIG", "Bug", etc); <buttondata-filter-column="1">/r$/</button> (matches text that ends with an "r")</td></tr>
<tr><tdclass="center"><code><<= >= ></code></td><td>Find alphabetical or numerical values less than or greater than or equal to the filtered query <smallclass="bright">(2)</small>.</td><td><buttondata-filter-column="5">>= 10</button> (find values greater than or equal to 10)</td></tr>
<tr><tdclass="center"><code>!</code></td><td>Not operator. Filter the column with content that <strong>do not</strong> match the query.</td><td><code>!fe</code> (hide rows with "female" in that column, but shows rows with "male"); <buttondata-filter-column="1">!a</button> (find text that doesn't contain an "a")</td></tr>
<tr><tdclass="center"><code> && </code> or <code> AND </code></td><td>Logical "and". Filter the column for content that matches text from either side of the operator.</td><td><code>box && bat</code> (matches a column cell that contains both "box" and "bat"); <buttondata-filter-column="1">Br && c</button> (Find text that contains both "br" and "c")</td></tr>
<tr><tdclass="center"><code>|</code> or <code> OR </code></td><td>Logical "or" (Vertical bar). Filter the column for content that matches text from either side of the bar <smallclass="bright">(3)</small>.</td><td><code>box|bat</code> (matches a column cell with either "box" or "bat"); <buttondata-filter-column="1">Alex|Peter</button> (Find text that contains either "Alex" or "Peter")</td></tr>
<tr><tdclass="center"><code> - </code> or <code> to </code></td><td>Find a range of values. Make sure there is a space before and after the dash (or the word "to") <smallclass="bright">(4)</small>.</td><td><buttondata-filter-column="3">10 - 30</button> or <buttondata-filter-column="4">10 to 30</button> (match values between 10 and 30)</td></tr>
<spanclass="bright">(2)</span> The filter order (or precendence) of how searches are checked is as follows: <spanclass="smallcode">regex (<code>/\d/</code>) <strong>></strong> operators (<code><<= >= ></code>) <strong>></strong> exact (<code>"</code>) <strong>></strong> not match (<code>!</code>) <strong>></strong> and (<code> AND </code>) <strong>></strong> range (<code> - </code>) <strong>></strong> wild/or (<code>?</code>, <code>*</code> and <code> OR </code>) <strong>></strong> fuzzy (<code>~</code>); so an exact match will override "and", "or" and "range" searches </span> (*NOTE* order changed in <spanclass="version updated">v2.15</span>, operators prioritized before exact; see <ahref="https://github.com/Mottie/tablesorter/issues/465">issue #465</a>) <br>
<spanclass="bright">(3)</span> Logical "or" comparisons can now show exact matches (by default; <spanclass="version">v2.10.1</span>) or just match cell contents.<br>
<spanclass="bright">(4)</span> In tablesorter <spanclass="version">v2.10</span>, comparisons can be made in date columns (if properly parsed).
<h4>Filter widget defaults (added inside of tablesorter <code>widgetOptions</code>)</h4>
<div>
<spanclass="label label-info">TIP!</span> Click on the link in the function column to reveal full details (or <ahref="#"class="toggleAll">toggle</a>|<ahref="#"class="showAll">show</a>|<ahref="#"class="hideAll">hide</a> all) or double click to update the browser location.
<td>If <code>true</code>, filters are hidden initially, but can be revealed by hovering over the filter row, or giving a filter input focus (tabbing down the page).</td>
<td>jQuery selector string (or jQuery object) of external anyMatch filter (<spanclass="label alert">removed</span> in v2.15; please see <ahref="example-widget-filter-any-match.html">the demo</a> for more details)</td>
<li><code>filter-false</code> - disable the filter for a specific header column.</li>
<li><code>filter-select</code> - build a default select box for a column (shows unique column content). See the <ahref="example-widget-filter-custom.html">custom filter widget</a> demo for an example.</li>
<li><code>filter-select-nosort</code> - when a default select box is built, this option prevents the sorting of select options leaving them in their original table order (<spanclass="version">v2.16.3</span>).</li>
<li><code>filter-match</code> - applies to "filter-select" columns and columns where the user can use the logical "or" search. Makes the filter/select match the column contents instead of exactly matching.</li>
* Note: using this search method will update the contents of the filters within the filter row.<br>
<br>
In <spanclass="version updated">v2.15</span>, one additional parameter can be added to the array to perform an "any-match" of the table; <spanclass="label warning">Warning!</span> please note that if no external input (with a <code>data-column="all"</code> is attached using <ahref="index.html#function-bindsearch"><code>bindSearch</code></a> function) is visible, the user will not know that a filter has been applied. <preclass="prettyprint lang-js">// in a table with 4 columns; set the 5th parameter to any-match
$('table').trigger( 'search', [['', '', '', '', 'orange']] ); // find orange in any column</pre>
This method returns an array of filter values or <code>false</code> if the selected table does not contain a filter row.<br>
<br>
Internally, the get filters functions returns the filters stored within this table data <code>$('table').data('lastSearch')</code>, unless an additional parameter of <code>true</code> is passed to the function:
<preclass="prettyprint lang-javascript">$.tablesorter.getFilters( $('table'), true ); // get current input values instead of data stored filters</pre>
As of <spanclass="version updated">v2.15</span>, if an external "any-match" filter (see <code>filter_external</code> widget option) is included, one additional array parameter will be returned in the filter - the value of the any match search.
<preclass="prettyprint lang-js">// in a table with six columns, this function will return an array with seven
Set the values of the actual filters using this method; include a <code>true</code> boolean to actually apply the search (<spanclass="version">v2.9</span>).
This method returns <code>true</code> if the filters were sucessfully applied, or <code>false</code> if the table does have a filter row.<br>
<br>
As of <spanclass="version updated">v2.15</span>, if an external "any-match" filter (see <code>filter_external</code> widget option) is included, add an additional array parameter to set that filter; so if a table has six columns, add the any-match search as the seventh value.
<preclass="prettyprint lang-js">// in a table with 6 columns, the 7th filter will apply
// to the any-match filter & match any table column with "11"
Use this method to bind external search filters; include a data-attribute <code>data-column</code> with the column index to target, or use <code>data-column="all"</code> to preform an "any-match" search (<spanclass="version updated">v2.15</span>). If no <code>data-column</code> is added to the input, the input will be ignored.
<preclass="prettyprint lang-html"><!-- will perform an "any-match" type of search (matches any column) -->
<p>You can now change the language of the searches used within the filter widget. For example, to change the localization to French, do the following:
<preclass="prettyprint lang-js">// add French support
$.extend($.tablesorter.language, {
to : 'à',
or : 'ou',
and : 'et'
});</pre>If you want to support multiple languages, separate the language variables with a vertical bar (<code>|</code>, <kbd>Shift</kbd> + <kbd>\</kbd>):
<preclass="prettyprint lang-js">// add French & Spanish support
$.extend($.tablesorter.language, {
to : 'à|a',
or : 'ou|o',
and : 'et|y'
});</pre><spanclass="label label-info">Note</span> These changes still require the user to enter spaces in the filter to perform the search, e.g. <code>1 à 10</code> (shows rows with numbers between 1 and 10).
<buttontype="button"class="toggle fic">Toggle</button> filter_ignoreCase : <spanid="case">true</span> (if false, the search will be case sensitive)<br>
<buttontype="button"class="toggle ffm">Toggle</button> filter-match (if class name added to the "First Name" column, all "or" searches will only match the content; Search <buttondata-filter-column="1">alex|br*|c</button> in the First Name column (<spanclass="version">2.10.1</span>).