table
table copied to clipboard
Feature Request: Infinite Scroller
In this PR, I added infinite scroller feature to rc-table.
You can check this page to see what would the feature look like.
There is also another example using placeholders to improve the overall rendering performance.
Details
An optional prop containing the following fields called virtualized is added to configure the infinite scroller feature:
| name | type | required | usage |
|---|---|---|---|
| renderNumber | int | yes | how many rows to render |
| redundantNumber | int | yes | how many redundant rows to render before and after the screen as buffer zone |
| bodyHeight | int | yes | height of the table body |
| placeholder | reactNode | no | placeholder to show when the user is scrolling at a fast speed to improve the rendering performance when the row content is too complex |
| loadMoreThreshold | int | no | when to load next batch of data(for example: If 600 existing rows were rendered currently, then next batch of data is to be fetched after the user scolls to the 600-loadMoreThreshold rows) |
| loadMore | function | no | callback to be invoked when more data is ought to be fetched |
| loadingMore | bool | no | whether or not more data is being fetched |
| loadingIndicator | reactNode | no | Indicator to be rendered at the end of the table telling the user more data is about to come |
Compatibility
- Backward compatible, when virtualized prop is empty, the behavior is the same as the original version of rc-table.
- No break change.
- All unit test passed.
- All lint passed.
Codecov Report
Merging #231 into master will decrease coverage by
0.70%. The diff coverage is68.00%.
@@ Coverage Diff @@
## master #231 +/- ##
==========================================
- Coverage 93.38% 92.68% -0.71%
==========================================
Files 17 17
Lines 726 670 -56
Branches 208 197 -11
==========================================
- Hits 678 621 -57
- Misses 40 41 +1
Partials 8 8
| Impacted Files | Coverage Δ | |
|---|---|---|
| src/BodyTable.js | 85.71% <50.00%> (-8.74%) |
:arrow_down: |
| src/TableRow.js | 90.09% <55.55%> (+4.11%) |
:arrow_up: |
| src/Table.js | 85.71% <57.89%> (-0.68%) |
:arrow_down: |
| src/BaseTable.js | 97.10% <84.61%> (-2.90%) |
:arrow_down: |
| src/TableCell.js | 96.22% <87.50%> (-1.60%) |
:arrow_down: |
| src/ColumnManager.js | 100.00% <100.00%> (+1.20%) |
:arrow_up: |
| src/TableHeaderRow.js | 97.05% <100.00%> (+0.08%) |
:arrow_up: |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact),ø = not affected,? = missing dataPowered by Codecov. Last update cd5ad56...4b3a83b. Read the comment docs.
@lo-tp Could you add a example under https://github.com/react-component/table/tree/master/examples
@yesmeck , I'll write an example tomorrow.
We have an example for the virtualized feature now. @yesmeck
any updates on when to release this feature with rc-table and antd?
@yesmeck @lo-tp any help needed to merge this PR?
@kafkahw I fell sorry to tell you there's nothing I could do to advance this PR.
Sorry, really busy this month, reviewing.
Got two warnings when I scroll the sample table to the bottom.

Table needs to have a height to make the scrollbar reflect the real situation.
The header is not aligned after resize the window.
@lo-tp @yesmeck When can we expect this to be merged? Are we blocked on something?
Is there any way we would be able to use react-virtualized for this (just like in the list component)?
Hi there, Is there a way to use infinte scroller before it's merged?
什么时候可以合并呢
Can we please merge this? This is going to be really useful. Thanks
any update on this?
Adding that this would be super useful.
Any updates???????
yeah any updates???
yeah any updates???
any progress ?
any progress ?
any progress ?
@yesmeck, Could you please tell what are waiting for?
rowSelection currently doesn't work with infinite scroll table / virtual list table.
any updates on when it could be merged?
Is there any update on this?
Can we pleaseeeeeee release this, what are we waiting for
Status on this?