admin管理员组文章数量:1332403
The react-table ponent is really cool and getting the data in is a breeze.
But when I try to get a detail ponent to load when a row is expanded it seems to confuse the row code. I've tried to use the ponentWillMount or update functions of the React Component class but when I expand the row it collapses again.
I'm using axios to fetch the data from a server , feed it into the redux state and add it to the row data but the row data in the table doesn't seem to update when the data in the redux state updates.
Does react-table support this use-case?
The react-table https://react-table.js ponent is really cool and getting the data in is a breeze.
But when I try to get a detail ponent to load when a row is expanded it seems to confuse the row code. I've tried to use the ponentWillMount or update functions of the React Component class but when I expand the row it collapses again.
I'm using axios to fetch the data from a server , feed it into the redux state and add it to the row data but the row data in the table doesn't seem to update when the data in the redux state updates.
Does react-table support this use-case?
Share Improve this question asked Aug 15, 2017 at 19:12 MichaudMichaud 1,1068 silver badges12 bronze badges 2- What do you want to achieve? Have you looked into this example: react-table.js/#/story/sub-ponents ? – An Nguyen Commented Aug 15, 2017 at 19:15
- yes, I did look at the example, but that uses the one data set for the table and the subponent. I made the subponent an actual react ponent. What I want to achieve is: show data in table > expand row > load more data , show it in the expanded row. – Michaud Commented Aug 15, 2017 at 22:11
1 Answer
Reset to default 7I've had the same problem. So far, I managed to stop the expanded row from collapsing by adding this property to the main table
freezeWhenExpanded={true}
本文标签: javascriptreacttable load detail data when row is expandedStack Overflow
版权声明:本文标题:javascript - react-table load detail data when row is expanded - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742277980a2445554.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论