table icon indicating copy to clipboard operation
table copied to clipboard

Feature Request: Infinite Scroller

Open lo-tp opened this issue 7 years ago • 38 comments

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.

lo-tp avatar Aug 20 '18 01:08 lo-tp

Codecov Report

Merging #231 into master will decrease coverage by 0.70%. The diff coverage is 68.00%.

Impacted file tree graph

@@            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 data Powered by Codecov. Last update cd5ad56...4b3a83b. Read the comment docs.

codecov-io avatar Aug 20 '18 01:08 codecov-io

@lo-tp Could you add a example under https://github.com/react-component/table/tree/master/examples

yesmeck avatar Aug 22 '18 13:08 yesmeck

@yesmeck , I'll write an example tomorrow.

lo-tp avatar Aug 22 '18 14:08 lo-tp

We have an example for the virtualized feature now. @yesmeck

lo-tp avatar Aug 23 '18 08:08 lo-tp

any updates on when to release this feature with rc-table and antd?

kafkahw avatar Sep 07 '18 16:09 kafkahw

@yesmeck @lo-tp any help needed to merge this PR?

kafkahw avatar Sep 25 '18 19:09 kafkahw

@kafkahw I fell sorry to tell you there's nothing I could do to advance this PR.

lo-tp avatar Sep 26 '18 01:09 lo-tp

Sorry, really busy this month, reviewing.

yesmeck avatar Sep 26 '18 03:09 yesmeck

screen shot 2018-09-26 at 14 46 55

Got two warnings when I scroll the sample table to the bottom.

yesmeck avatar Sep 26 '18 06:09 yesmeck

14_58_16__09_26_2018

Table needs to have a height to make the scrollbar reflect the real situation.

yesmeck avatar Sep 26 '18 07:09 yesmeck

screen shot 2018-09-26 at 15 02 29

The header is not aligned after resize the window.

yesmeck avatar Sep 26 '18 07:09 yesmeck

@lo-tp @yesmeck When can we expect this to be merged? Are we blocked on something?

ganesharulanantham avatar Oct 10 '18 21:10 ganesharulanantham

Is there any way we would be able to use react-virtualized for this (just like in the list component)?

sammarks avatar Oct 14 '18 22:10 sammarks

Hi there, Is there a way to use infinte scroller before it's merged?

AonanLi avatar Nov 07 '18 22:11 AonanLi

什么时候可以合并呢

Nokecy avatar Dec 03 '18 05:12 Nokecy

Can we please merge this? This is going to be really useful. Thanks

fgiarritiello avatar Feb 01 '19 04:02 fgiarritiello

any update on this?

12tp12 avatar Mar 03 '19 09:03 12tp12

Adding that this would be super useful.

dylanjt avatar Mar 07 '19 01:03 dylanjt

Any updates???????

evanzombie avatar Mar 19 '19 13:03 evanzombie

yeah any updates???

stunaz avatar Apr 18 '19 02:04 stunaz

yeah any updates???

codeXian avatar Jun 13 '19 05:06 codeXian

any progress ?

ssbabysong avatar Aug 05 '19 07:08 ssbabysong

any progress ?

garfiaslopez avatar Aug 18 '19 21:08 garfiaslopez

any progress ?

TheOrphan avatar Nov 06 '19 05:11 TheOrphan

@yesmeck, Could you please tell what are waiting for?

monolithed avatar Jan 29 '20 14:01 monolithed

rowSelection currently doesn't work with infinite scroll table / virtual list table.

deresegetachew avatar Feb 13 '20 16:02 deresegetachew

any updates on when it could be merged?

Timikcool avatar Feb 14 '20 12:02 Timikcool

Is there any update on this?

JoeCMorgan avatar Apr 07 '20 10:04 JoeCMorgan

Can we pleaseeeeeee release this, what are we waiting for

StallionV avatar Apr 21 '20 22:04 StallionV

Status on this?

axelyung avatar Jul 16 '20 15:07 axelyung