Skip to content

Filtering on non-text items #2429

Answered by tannerlinsley
jdmcd asked this question in General
Jun 9, 2020 · 4 comments · 4 replies
Discussion options

You must be logged in to vote

The best way to do this is to have your data in it's primitive format as you pass it to accessors. So if you have a link to a user, you would want to pass columns that access things like user.id and user.name. This way, sorting and filtering work without any modifications by using the data that is accessed using the accessor. Then you can use a custom Cell renderer to build things like links or images. Here is an example of a column that uses the user's name as the accessed value for sorting and filtering, but displays that name as a link and even uses the user ID from the original row.

{ id: 'userName', accessor: row => row.name, Cell: ({ value, row }) => <Link to={`/users/${row.original…

Replies: 4 comments 4 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
4 replies
@jdmcd
Comment options

@tannerlinsley
Comment options

@jdmcd
Comment options

@joshribakoff-sm
Comment options

Answer selected by tannerlinsley
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
4 participants