-
is it possible to filter a column by a key in an object? what alternative should I do to achieve the filtering btw, the data structure for the table was like this |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Yes it is possible, by using a callback. Instead of a key name, <ThFilter {handler} filterBy={(row) => row.leadDetail.brand}/> With handler.filter(value, (row) => row.leadDetail.brand) Note that filter by an object works too: |
Beta Was this translation helpful? Give feedback.
-
Ah.... so you can just use a function in that |
Beta Was this translation helpful? Give feedback.
Yes it is possible, by using a callback.
Instead of a key name,
filterBy
can take a function as argument:With
DataHandler
instance:Note that filter by an object works too:
filterBy="leadDetail"
will filter bybrand
+phone
+ ...