Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add scroll listener to nz-table #2886

Closed
Endran opened this issue Feb 13, 2019 · 4 comments · Fixed by #3297
Closed

Add scroll listener to nz-table #2886

Endran opened this issue Feb 13, 2019 · 4 comments · Fixed by #3297
Assignees

Comments

@Endran
Copy link

Endran commented Feb 13, 2019

What problem does this feature solve?

NzTable doens't expose (scroll) from table. This feature will expose (scroll).

When working with large data sets the performance of nzTable doesn't cut it. We have a view with 200 rows and 20 columns, and each entry has a checkbox. I guess this isn't standard use of nzTable, we've used nzTable before with smaller data sets and it works fine. But for this use-case I need to know where in the table the user is, so that I can do some performance enhancements with my dataset.

What does the proposed API look like?

 <nz-table
      ...
      (nzScroll)="scrolled($event)">...

scrolled({x: number, y:number}) {
       ...
}

By exposing the location of the view I can reduce draw events for data that isn't displayed. It will also enable dynamic loading when I would want to prefetch data in advance.

@vthinkxie
Copy link
Member

vthinkxie commented Feb 22, 2019

we will support virtual scroll in the next version.
you can check the preview of it here
https://5c70006a50d1090008d52d92--ng-zorro-master.netlify.com/components/table/en#components-table-demo-virtual

@vthinkxie vthinkxie self-assigned this Feb 26, 2019
@charlescc
Copy link

I think expose (scroll) from table is also necessary for some situation, as for using NextToken params to make pagination , onScroll can be used for loading next page.

@lppedd
Copy link
Contributor

lppedd commented May 8, 2019

@charlescc has CdkVirtualScrollViewport been sufficient for you? I'm looking around at what is the better solution to avoid having massive (10000+ elements) arrays in memory after the user keep scrolling down.

@lppedd
Copy link
Contributor

lppedd commented May 8, 2019

EDIT: version problem, solved.

And btw, I'm still not natively able to find the field cdkVirtualScrollViewport.
image

andrew-yangy pushed a commit to andrew-yangy/ng-zorro-antd that referenced this issue Jun 20, 2019
Ricbet pushed a commit to Ricbet/ng-zorro-antd that referenced this issue Apr 9, 2020
hsuanxyz pushed a commit to hsuanxyz/ng-zorro-antd that referenced this issue Aug 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants