- NOTE! +
++
+
+
+
+
+ Notes
+-
-
- This is a demo of the
filter_anyMatch
option (v2.13.3).
- - This method has limitations in that it does not support all of the per column search features! So, at this time, the following types of queries are not allowed as the results will cause confusion: +
- This is a demo of the
filter_external
option (added v2.15).
+ - In v2.15
+
-
+
- The
filter_anyMatch
has been removed (added v2.13.3; removed in v2.15)
+ - A new option
filter_external
has been added. It is set to a jQuery selector string ('.search'
) or jQuery object ($('.search')
) targetting an external input.
+ - So now a table can include both a filter row (
filter_columnFilters
istrue
, i.e. the internal table filters) and any number of external search inputs (as set by thefilter_external
option).
+ - The external search results must have a
data-column="#"
attribute set, where#
is the index of the column (zero-based) that the input targets, to have an input search all table content, set the data column attribute to"all"
to match any column.
+ - The
$.tablesorter.bindSearch
function (see demo) does exactly the same thing as thefilter_external
option. The major difference is seen when using ajax to populate the table, the initial filter values can be set before tablesorter initialization when using tehfilter_external
option; whereas, the bind search function can not set initial filter values and is usually executed after tablesorter initialization.
+
+ - The
Limitations
+
+
+ -
+
- The any-match search method has limitations applied. It does not support all of the per column search features! So, at this time, the following types of queries are not allowed as the results will cause confusion:
- Search operators - A search for values equal, greater or less than values (
> >= <= <
) is not allowed because tables that contain both numbers and text (in separate columns). For example:"Fred" > "1" // true* -"Fred" < "10" // false -"Fred" > 1 // false (numeric comparisons occur with parsed table data) -"Fred" > 1 // false -"Fred" < 10 // false
* For comparisons, letters have a greater ASCII value than numbers. +"Fred" < "10" // false +"Fred" > 1 // false (numeric comparisons occur with parsed table data) +"Fred" > 1 // false +"Fred" < 10 // false* For comparisons, letters have a greater ASCII value than numbers. - Range query - A search for any number range (
1 - 10
) is not allowed because, if any columns contain text, then no rows will result. The examples are the same as the search operators examples above. - Not Match query - A search for not matches (
!a
) is not allowed because tables that contain both numbers and text (in separate columns) will always show all rows. For example: @@ -91,15 +99,19 @@ columns[5] = '2?%'; $('table').trigger('search', [ columns ]);
- Search operators - A search for values equal, greater or less than values (
Demo
-
-
-
+
(Match any column)
+ (First Name)
-
+
+
+
+
+ (First Name)
-
Rank | diff --git a/docs/example-widget-filter.html b/docs/example-widget-filter.html index c8cc75e2..2d346a56 100644 --- a/docs/example-widget-filter.html +++ b/docs/example-widget-filter.html @@ -5,11 +5,11 @@
---|