diprokon/ng-table-virtual-scroll

adding new TableVirtualScrollDataSource not working

Cipa opened this issue · 2 comments

Cipa commented

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

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

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