Primeng: Virtual scroll + lazy load repeating rows

Created on 12 Sep 2017  路  3Comments  路  Source: primefaces/primeng

When using virtual scroll and lazy loading new data are displayed with already loaded records. So you have to scroll all the time from the beginning of the table. You can reach last records only if all records are already loaded

primeng 4.2.0-rc.1

<p-dataTable [value]="objects" loadingIcon="fa-spinner" scrollable="true" [rows]="11" virtualScroll="true" scrollHeight="451px" lazy="true" [totalRecords]="totalRecords" (onLazyLoad)="loadObjectsLazy($event)">
...
</p-dataTable>

loadObjectsLazy(event: LazyLoadEvent) {
this.searchService.getObjects(this.search).then((data: any) => {
this.totalRecords = data.totalOfRecords;
this.objects = data.objects;
this.search.offset = this.search.offset + data.objects.length;
});
}

defect

Most helpful comment

This is still very much present in 4.2.0. Sure it "works", but the way it looks is really bad. If you have a lazy-load table showing values from 200 -> 0, you'll keep repeating 200 -> 190 until it suddenly manages to load something within the "timer" and suddenly shows 140 (for example). Really lazily done.

All 3 comments

This is still very much present in 4.2.0. Sure it "works", but the way it looks is really bad. If you have a lazy-load table showing values from 200 -> 0, you'll keep repeating 200 -> 190 until it suddenly manages to load something within the "timer" and suddenly shows 140 (for example). Really lazily done.

Hi, Any updated please ? I get same issue using primefaces 6.1

Unfortunatly , as of PrimeNG 8.0.0, this is always an issue....

Was this page helpful?
0 / 5 - 0 ratings