Is it possible to add infinite scrolling to React Tool Box Table body?

和自甴很熟 提交于 2019-12-12 04:57:51

问题


I am using react-toolbox table component in my app(react-toolbox for material styles implementation). I need to add infinite scrolling pagination for the table body. I found some libraries which does this for me, some of those are react-infinite, react-infinite-scroller, But the problem is, to use any library I need to put table rows as children inside the their library component, but ract-toolbox table does not allow me to use any div's or special components inside, from the docs:

An element that represents a row in the Table. It should be place as a direct descendant of Table and it should has TableCells children. It receives extra properties from Table to decide if checkboxes should be placed as a first column.

Actually there is a closed issue on their library but it does not solved my problem. Please help me to do this, or suggest me a suitable library (or) if there is any other way to infinite pagination with out using any library? Any help would be appreciated.


回答1:


Try to wrap a table inside a div and give a fixed height to that div also make overflow-y: scroll table will be rendered inside the div which will be scrollable and also of fixed height.

Then render this whole markup as children of react-infinite-scroller



来源:https://stackoverflow.com/questions/45631339/is-it-possible-to-add-infinite-scrolling-to-react-tool-box-table-body

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!