mirror of
https://github.com/Mottie/tablesorter.git
synced 2024-11-15 23:54:22 +00:00
Filter: fix onlyAvail setting causing a js error on init
This commit is contained in:
parent
28cdec1b60
commit
f8a6898168
@ -2342,9 +2342,11 @@ $(function(){
|
|||||||
<td>String</td>
|
<td>String</td>
|
||||||
<td>"filter-onlyAvail"</td>
|
<td>"filter-onlyAvail"</td>
|
||||||
<td>
|
<td>
|
||||||
Filter widget: If a header contains a select dropdown and this class name, only the available (visible) options in the column will show (<span class="version">v2.10.1</span>).
|
Filter widget: If a header contains a select dropdown and this class name, only the available (visible) options in the column will show (<span class="version">v2.10.1</span>; <span class="version updated">v2.17.6</span>).
|
||||||
<div class="collapsible">
|
<div class="collapsible">
|
||||||
<br>
|
<br>
|
||||||
|
In <span class="version">v2.17.6</span>, columns with the only available class name set, that <em>are not</em> currently being filtered will only show the available options. Conversely, the column(s) with a selected option will show all options.<br>
|
||||||
|
<br>
|
||||||
This option is useful after one or more columns have been filtered, then the column select filter with this class applied will only show the contents of the column within the dropdown that are currently visible. See the <a href="example-widget-filter-custom.html">custom filter widget</a> demo "Discount" column for an example (sort the "First Name" column first).<br>
|
This option is useful after one or more columns have been filtered, then the column select filter with this class applied will only show the contents of the column within the dropdown that are currently visible. See the <a href="example-widget-filter-custom.html">custom filter widget</a> demo "Discount" column for an example (sort the "First Name" column first).<br>
|
||||||
<br>
|
<br>
|
||||||
<span class="label label-warning">Caution:</span> The main issue with this functionality is with keyboard accessibility. If the keyboard is used to select an option, only the first and default options will be available for chosing. The only way to select other options is with the mouse.
|
<span class="label label-warning">Caution:</span> The main issue with this functionality is with keyboard accessibility. If the keyboard is used to select an option, only the first and default options will be available for chosing. The only way to select other options is with the mouse.
|
||||||
|
@ -1190,9 +1190,10 @@ ts.filter = {
|
|||||||
parsed = [],
|
parsed = [],
|
||||||
arry = false,
|
arry = false,
|
||||||
source = wo.filter_selectSource,
|
source = wo.filter_selectSource,
|
||||||
|
last = c.$table.data('lastSearch') || [],
|
||||||
fxn = $.isFunction(source) ? true : ts.getColumnData( table, source, column );
|
fxn = $.isFunction(source) ? true : ts.getColumnData( table, source, column );
|
||||||
|
|
||||||
if (onlyAvail && c.$table.data('lastSearch')[column] !== '') {
|
if (onlyAvail && last[column] !== '') {
|
||||||
onlyAvail = false;
|
onlyAvail = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user