getSubRows function to get tree from flat data #2361
Unanswered
agneyaloya
asked this question in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm looking for some pointers on how I should modify the getSubRows function to display a tree data from data that looks like below:
data=[ { id: 1, name: 'Parent-name', parentId: '', }, { id: 2, name: 'Child of 1', parentId: 1, }, { id: 3, name: 'Child of 2', parentId: 2, } ]
Documentation on getSubRows is here: https://github.com/tannerlinsley/react-table/blob/master/docs/api/useTable.md
I tried rewriting my code to build out the tree data structure that react-table prefers from the SQL database but it's overly complicated since data is fetched from multiple tables.
Beta Was this translation helpful? Give feedback.
All reactions