diff --git a/docs/example-widget-filter-custom-search.html b/docs/example-widget-filter-custom-search.html index 77f91630..aff556ec 100644 --- a/docs/example-widget-filter-custom-search.html +++ b/docs/example-widget-filter-custom-search.html @@ -100,6 +100,7 @@ $(function() {
data.matchedOn
value was added. See the How to add Custom filter types section below.data
parameter as it is now provided as a parameter to all filter_functions
. See the "How to add Custom filter types" section below to review the new additions.data.cacheArray
- An array of parsed content from each table cell in the row being processed.data.childRowText
- contains all text from any associated child rows.data.parsed
- An array of boolean flags that indicate if the column data should be obtained from parsed values, or not; obtained from filter_useParsedData
setting or filter-parsed
classes on the header cells.
+ data.parsed
- An array of boolean flags that indicate if the column data should be obtained from parsed values, or not; obtained from filter_useParsedData
setting or filter-parsed
classes on the header cells.data.matchedOn
- The name of the filter type function (see the Built-in Filters section above for a list) that returned a match, either true
or false
. If no type was matched, it will contain a null
value; added v2.29.1.data
parameter was added to that long list of parameters.
+ In v2.22.0, a data
parameter was added to that long list of parameters.
*WARNING* In a future update, the filter function parameters will be cleaned up and changed as follows!
filter_functions : { // function(e, n, f, i, $r, c, data) {} <- current parameters diff --git a/js/widgets/widget-filter.js b/js/widgets/widget-filter.js index 5a5b7607..2233eee2 100644 --- a/js/widgets/widget-filter.js +++ b/js/widgets/widget-filter.js @@ -1115,6 +1115,7 @@ if ( $.inArray( ffxn, vars.excludeMatch ) < 0 && matches === null ) { matches = tsf.types[ffxn]( c, data, vars ); if ( matches !== null ) { + data.matchedOn = ffxn; filterMatched = matches; } } @@ -1162,6 +1163,7 @@ tsf.multipleColumns( c, wo.filter_$anyMatch ) : []; data.$cells = data.$row.children(); + data.matchedOn = null; if ( data.anyMatchFlag && columnIndex.length > 1 || ( data.anyMatchFilter && !hasAnyMatchInput ) ) { data.anyMatch = true; data.isMatch = true; @@ -1263,7 +1265,9 @@ // cycle through the different filters // filters return a boolean or null if nothing matches filterMatched = tsf.processTypes( c, data, vars ); - if ( filterMatched !== null ) { + // select with exact match; ignore "and" or "or" within the text; fixes #1486 + txt = fxn === true && (data.matchedOn === 'and' || data.matchedOn === 'or'); + if ( filterMatched !== null && !txt) { result = filterMatched; // Look for match, and add child row data for matching } else {