-
Is there no way with react-table to remote filter or sort your columns ASC or DESC? However, this also isn't very useful. I am assuming there could be a way to send the |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
I found a way to implement this. For the
From there, when you call your
Backend will depend on language probably, but in .NET Core/C#, I had to use reflection to match against string key column names passed from Just general ideas here, wasn't all that trivial and would be nice if there were some info in the documentation. |
Beta Was this translation helpful? Give feedback.
I found a way to implement this. For the
react-table
side of things, I needed to use thefilters
andsortBy
(arrays of key value pair objects which the key is the column name, and value is your filtering/descending or not value) that you can pass intostate:
in yourcreateTable()
function:From there, when you call your
fetchData
within the component ofreact-table
withuseEffect
(just like documentation: https://react-table-v7.tanstack.com/docs/examples/pagination-controlled) you can addfilters
andsortBy
to the dependency array of theuseEffect
call. It seems I have to havefilter
andsortBy
states outside in the component where thefetc…