问题
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