datatables.mark.js icon indicating copy to clipboard operation
datatables.mark.js copied to clipboard

Quoted search string doesn't get highlighted in search results

Open abunch opened this issue 8 years ago • 6 comments

When placing the search value within quotes in the DataTables search box the correct value is located but not highlighted.

For example when searching for: Doe, John, DataTables finds all records with "Doe" and/or "John". If I want to locate the one record with "Doe, John" I enclose the search value in quotes, DataTables then correctly finds that record but the search value isn't highlighted.

abunch avatar Nov 19 '17 16:11 abunch

@DataTables Is there any way to retrieve the search term that is used by DataTables internally?

julkue avatar Nov 19 '17 18:11 julkue

This is the bit of code where DataTables is doing that. It doesn't present that externally at all - it would effectively need to be re-implemented. I can't really think how it would be presented externally...?

DataTables avatar Nov 20 '17 09:11 DataTables

@DataTables What the plugin currently does is retrieving the search term using: https://github.com/julmot/datatables.mark.js/blob/master/src/datatables.mark.js#L64

So, if the actual search term is modified during the lifetime of DataTables, I'd expect that these changes are reflected in the API call or there is another method to retrieve the "real" search term.

julkue avatar Jan 09 '18 08:01 julkue

Currently no - the regular expression that DataTables builds is not exposed at all I'm afraid. It was never intended for anything other than internal use in DataTables - but I can see how this would be a special situation where it could be useful.

I'm starting to draw up plans to revise how the filtering works in DataTables and I'll include this in that process.

DataTables avatar Jan 09 '18 09:01 DataTables

Any update on this? It's not critical but it does get noticed by users every few weeks or so and raises a question.

abunch avatar Jul 13 '18 18:07 abunch

I'm going to assign you @DataTables, according to your reply there's nothing that I can do at the moment due to missing API methods.

julkue avatar Jul 25 '18 07:07 julkue