Search by name and email
I have a Name column in which I have name and email, Can anybody tell me how to make search by name and email?

9 Replies
stormy-gold•17mo ago
in filterFns, you can access any data from the row from
row.original
narrow-beigeOP•17mo ago
Please can you help i am having problem in this from many days
Is there any example code that is available on web?
stormy-gold•17mo ago
What are you trying to do specifically that's not working?
What is your accessor for this column?
narrow-beigeOP•17mo ago
accessor key is name
stormy-gold•17mo ago
Well, the filters will match whatever values are in the accessor
narrow-beigeOP•17mo ago
1. This column contains names and corresponding email addresses.
2. Now, I need to implement a search feature.
How would you write the logic for input to search by both name and email?
If you could envision this scenario as your own, how would you tackle it?

narrow-beigeOP•17mo ago
@KevinVandy
optimistic-gold•17mo ago
Instead of using accessorKey in your column definition use accessorFn: (row) => { /* do some concat of name and email */} now that both strings are in the accessor the table functions will use it to match against the input I would think.
stormy-gold•17mo ago
are you using a custom filterFn for that column? That would be a good use case for one