T
TanStack2y ago
correct-apricot

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?
No description
9 Replies
broad-brown
broad-brown2y ago
in filterFns, you can access any data from the row from row.original
correct-apricot
correct-apricotOP2y ago
Please can you help i am having problem in this from many days Is there any example code that is available on web?
broad-brown
broad-brown2y ago
What are you trying to do specifically that's not working? What is your accessor for this column?
correct-apricot
correct-apricotOP2y ago
accessor key is name
broad-brown
broad-brown2y ago
Well, the filters will match whatever values are in the accessor
correct-apricot
correct-apricotOP2y 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?
No description
correct-apricot
correct-apricotOP2y ago
@KevinVandy
metropolitan-bronze
metropolitan-bronze2y 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.
broad-brown
broad-brown2y ago
are you using a custom filterFn for that column? That would be a good use case for one

Did you find this page helpful?