diprokon / ng-table-virtual-scroll

Virtual Scroll for Angular Material Table
https://diprokon.github.io/ng-table-virtual-scroll
MIT License
134 stars 42 forks source link

adding new TableVirtualScrollDataSource not working #70

Closed Cipa closed 3 years ago

Cipa commented 3 years ago

Hi,

the docs say we must do vDataSource = new TableVirtualScrollDataSource(ELEMENT_DATA); but for me it doesn't work

What works is just sending the data directly. So if you replace [dataSource]="vDataSource" with [dataSource]="dataSource" the cells are displayed but I don't know if the virtual scroll is working as expected

Maybe the docs need to be updated?

Thank you

Example: https://stackblitz.com/edit/angular-cpxqbh?file=src/app/table-basic-example.html

Update: Copy-pasting one of the examples in stackblitz has the same behavior, no cells if new TableVirtualScrollDataSource is used https://stackblitz.com/edit/angular-cpxqbh-nembpx?file=src%2Fapp%2Ftable-basic-example.ts

brandonsmith86 commented 3 years ago

Seeing the same behavior here. I found importing ScrollingModule in AppModule fixed this issue.

diprokon commented 3 years ago

Hi! @Cipa in your examples, you didn't import 'TableVirtualScrollModule' and used itemSize directive, not tvsItemSize. Please, read instructions and check the demo page - there are examples with stackblitz links