Global filter nested data
Hey 👋,
I have that kind of data
with this column def
This is my AnnonceAdresseCell component
I have enabled global filtering on other columns but it does not work on this column. For example if I type "Paris", the table show no results.
Do you know how I can filter nested objects ?
Thank you 🙂
1 Reply
rival-blackOP•10mo ago
The solution : make the first argument of the accessor function to be what you want to filter on.
From the doc : "🧠Remember, the accessed value is what is used to sort, filter, etc. so you'll want to make sure your accessor function returns a primitive value that can be manipulated in a meaningful way. If you return a non-primitive value like an object or array, you will need the appropriate filter/sort/grouping functions to manipulate them, or even supply your own! 😬"
cf : https://tanstack.com/table/v8/docs/guide/column-defs#accessor-functions