<li>The <code>getFilters</code> function will now target the last used filter properly.</li>
<li>The <code>selectSource</code> option now ignores parsers if none are set.</li>
<li>Added the ability to nest filter types with a logical "OR" or a logical "AND". Try these filters: <buttondata-filter-column="1">a && !o</button> (<spanclass="label warning">*NOTE*</span> try this with and without the filter-match class applied), <buttondata-filter-column="3"><10 or >40</button> or <buttondata-filter-column="3">>20 &&<40</button></li>
<li>Regex filter searches now cache the created regex object for each query to optimize speed & a regex search now properly uses case-sensitive content.</li>
<li>Add <code>data</code> parameter to <code>filter_functions</code> (<ahref="example-widget-filter-custom-search.html#how_to_add_custom_filter_types">get more details</a>).</li>
<li>Any match searches which target specific columns will no longer save each filter to its respective column; see <ahref="example-widget-filter-any-match.html#anymatch_searches">"AnyMatch Searches"</a> documentation.</li>
<li>Operator filter searchs now ignore empty strings (because <code>"" < 10</code> is <code>true</code>).</li>
<li>Added <code>filter_childByColumn</code> option which allows the filtering columns in both the parent & child rows. Demo added to the <ahref="example-child-rows-filtered.html#child-by-column">filtered child rows demo</a></li>
<li>In <spanclass="version updated">v2.18.0</span>, added <code>filter_cellFilter</code>& the ability to set multiple "any" match columns for an external search (see the <ahref="example-widget-filter-external-inputs.html">external inputs demo</a> for more details).</li>
<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>Adding a class of <code>"filter-select-nosort"</code> will now leave the select options unsorted (<spanclass="version">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>
</ul>
</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><spanclass="label alert">*NOTE*</span> If using a custom theme, make sure to add the class set in the <code>filter_filteredRow</code> option (set to <code>filtered</code> by default) in the css, and set it to <code>display:none</code>. When filtering rows, the filter widget adds the "filtered" class to hide the row; all available themes include this definition.</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>Using the built-in filters (<ahref="example-widget-filter-custom-search.html">learn how to customize them here</a> - demo created <spanclass="version">v2.17.5</span>):
<tr><tdclass="center">1</td><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"); <buttondata-filter-column="3"><10 or >40</button></td></tr>
<tr><tdclass="center">2</td><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"), <buttondata-filter-column="3">>20 &&<40</button> or <buttondata-filter-column="1">a and !o</button> (When "filter-match" is set, find content with the letter "a", but not the letter "o")</td></tr>
<tr><tdclass="center">3</td><tdclass="center"><code>/\d/</code></td><td>Add any regex to the query to use in the query ("mig" flags can be included <code>/\w/mig</code>)</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">4</td><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">5</td><tdclass="center"><code>!</code> or <code>!=</code></td><td>Not operator, or not exactly match. Filter the column with content that <strong>do not</strong> match the query. Include an equal (<code>=</code>), single (<code>'</code>) or double quote (<code>"</code>) to exactly <em>not</em> match a filter (<spanclass="version">v2.17.1</span>).</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");<buttondata-filter-column="1">!"Bruce"</button> (find content that does not exactly match "Bruce")</td></tr>
<tr><tdclass="center">6</td><tdclass="center"><code>"</code> or <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">7</td><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>
<tr><tdclass="center">8</td><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">8</td><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">9</td><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">10</td><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>
<spanclass="bright">(2)</span> The filter order (or precendence) of how searches are checked in "priority" (first column) order; so an exact match will override "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>; order changed again in <spanclass="version updated">v2.17.1</span> to move "not match" before "exact" and allow for exact not matches; see <ahref="https://github.com/Mottie/tablesorter/issues/628">issue #628</a>). In <spanclass="version updated">v2.22.2</span>, the "or" and "and" types can combine any of the other filter types together.<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).
<h5>This table includes very basic information about the filter options. For more extensive information & links to demos, see the main page <ahref="index.html#Widget-options">Widget & Pager Options</a> section.</h5>
<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.
The <code>filter_childRows</code> option must be <code>true</code> for this option to work.<br>
<br>
If <code>false</code>, and the <code>filter_childRows</code> option is <code>true</code>, then queries in <em>any column</em> will search all child content, as before this option was added.
<td>if <code>true</code>, allows using "#:{query}" in anyMatch searches (<spanclass="version">v2.20.0</span>).
<divclass="collapsible">
<br>
Users can use the anymatch input to target a specific column, using a one-based index.
<p></p>
For example: In the table below, searching for <code>2:aa</code> in an anymatch filter will result in "Phillip Aaron Wong" and "Aaron" showing in the First Name column.
<p></p>
See live examples in the <ahref="example-widget-filter-any-match.html#anymatch_searches">Filter Widget External Search</a> demo.
The filter cell (<code><td></code>) is not to be confused with the <code>filter_cssFilter</code> option which adds an extra class name to the filter inputs (<code><input></code>).
<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>
Set a <code>data-value</code> attribute (data-attribute name set by the <code>filter_defaultAttrib</code> option) on the associated table header with the desired initial search value.
or, just add an element to your page and point to it by setting the <code>filter_reset</code> option, to allow user interaction.
<p></p>
<spanclass="label label-info">*NOTE*</span> delegated event bindings are used so these "reset" elements can be dynamically added and removed from the document.
* 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"
<li>Include a data-attribute <code>data-column</code> with the column index to target</li>
<li>Or, use <code>data-column="all"</code> to preform an "any-match" search on all of the table columns (<spanclass="version updated">v2.15</span>).</li>
<li>Or, add multiple columns <code>data-column="0-2,4,6-8"</code> to perform an "any-match" search on selected columns (<spanclass="version">v2.18.0</span>).</li>
</ul>
If no <code>data-column</code> is added to the input, the input will be ignored.
<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>).