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
NzTableComponent should support CDK Datasource #3571
Comments
If you haven't got time for this, I can consider a PR, although I can't guarantee on the expected delivery time. Also, I think there is a design choice to make, as of now the code does strictly target a simple array. |
Hi @lppedd |
@vthinkxie The As you can see This request comes from the necessity to display an "audit" of user operations, thus this is potentially infinite going backwards, and while paging is still an option, an infinite scroll is a lot better for usability. |
@lppedd I got it, just feel free to submit PR for this, we will review it, thanks a lot for your proposal |
@vthinkxie do you prefer maintaining the array/datasource as two separate cases, or do you feel like an homogeneous implementation would be better? The first one would touch only the virtual scroll scenario, while the second would be an overall refactor I think (but I'll have to look at the code better) |
I think both solutions are ok, but it has to stay compatible with previous version |
@vthinkxie thanks! I will open the PR shortly. |
I'm now working on this full-time at work. The only solution seems to be
Alternatively, the |
@vthinkxie repro here, maybe you already saw something like that. |
@lppedd thanks to your efforts! |
@vthinkxie I've done a bit of refactoring. |
any updates on this? or it was scrapped |
@fattikus unfortunately I don't work anymore on Angular, and I don't have an environment to develop this. But with recent API changes it should be easier for you to complete. |
Any update on this??? Nowadays there is no other alternative to implementing the virtual scroll in zorro's table? |
@borjaj14 hi! You could try to finish this PR. My initial implementation was architecturally fine as far as I remember, it should be pretty easy to understand and pick it up |
What problem does this feature solve?
NzTableComponent
will be able to support virtual scrolling of unknown size data sources.Currently, unlike
NzListComponent
, the table component supports only a static array as input, even for virtual scrolling. This limits the table capabilities, as it uses the Angular CDK virtual scroll viewport, which supports aDatasource
implementation natively (@angular/cdk/collections
).ng-zorro-antd/components/table/nz-table.component.html
Line 50 in f7fd1e9
Custom solutions do indeed work. However they work poorly, especially in respect to change detection and scrolling behavior.
What does the proposed API look like?
NzTableComponent
should acceptnzData: T[] | Datasource<T>;
.The text was updated successfully, but these errors were encountered: