Replies: 1 comment 1 reply
-
Here is a simple global text search example: https://codesandbox.io/s/react-table-global-fuzzy-text-search-2y55j2?file=/src/App.js const globalFilter = useCallback(
(rows: Row<RowData>[], ids: IdType<string>[], query: string) => {
const searchTerm = String(query).toLowerCase();
return rows.filter((row) => {
const matches = ids.filter((id) => {
const rowValue = row.values[id];
return rowValue !== undefined
? String(rowValue).toLowerCase().includes(searchTerm)
: false;
});
return matches.length > 0;
});
},
[],
); Check out https://github.com/kentcdodds/match-sorter if you need more advanced fuzzy text searching. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
so first of all thanks for this great module. Now to my question:
I would like to use a GlobalFilter to search my entire table with a fuzzy search.
Ho can i pass my fuzzy search filtertype as a globalFilter type?
Maybe someone has an example.
Thanks a lot
Beta Was this translation helpful? Give feedback.
All reactions