Please add ability to highlight text matched by filter similar to search result highlighting in data tables. datatables.net/blog/2014-10-22
This has already been requested in #1527. We'll track it there. Thanks!
Hey, just implemented the global search but I'm not seeing anything regarding highlighting in issue #1527
It is possible to get the current filters state — both for the regular filters and for the global filter — inside the Cell method of the columns options.
They're available inside the state, so for the global filter we can get it like this (imagine this being inside the columns definition and having a highlight function that would do the work for you):
Cell: ({ cell: { value }, state: { globalFilter } }) => highlight(value, globalFilter)
Most helpful comment
It is possible to get the current filters state — both for the regular filters and for the global filter — inside the
Cellmethod of thecolumnsoptions.They're available inside the
state, so for the global filter we can get it like this (imagine this being inside thecolumnsdefinition and having ahighlightfunction that would do the work for you):