是否可以向React Tool Box Table主体添加无限滚动? [英] Is it possible to add infinite scrolling to React Tool Box Table body?

查看:127
本文介绍了是否可以向React Tool Box Table主体添加无限滚动?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 react-infinite react-infinite-scroller ,但是问题是,要使用我需要放在表中的任何库行作为其库组件内的子组件,但是ract-toolbox表不允许我从文档中使用任何div或特殊组件:

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:

表示表格中一行的元素.它应该作为一个地方 Table的直接后代,它应该具有TableCells子代.它 从Table接收额外的属性,以决定是否应选中复选框 放在第一列.

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.

推荐答案

尝试将表格包装在div内并为该div赋予固定高度,还使overflow-y: scroll表格将在div内呈现,并且可滚动并也是固定高度的.

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.

然后将整个标记呈现为react-infinite-scroller

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

这篇关于是否可以向React Tool Box Table主体添加无限滚动?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆