July 2017
Intermediate to advanced
384 pages
8h 23m
English
To deal with huge datasets, this component supports the lazy loading feature as well. Instead of loading whole data, it loads chunks of data on each scroll action. It requires both lazy and onLazyLoad properties to enable this behavior. The lazy loading example of DataScroller would be written as follows:
<p-dataScroller [value]="lazyloadingBrowsers" [rows]="5" [lazy]="true" (onLazyLoad)="loadData($event)"> //Content goes here</p-dataScroller>
The component class defines the lazy loading event callback to retrieve the data in chunks as shown here:
loadData(event: any) { let start = event.first; //event.first = First row offset let end = start + event.rows; //event.rows = Number of rows per page this.browserService.getBrowsers().subscribe((browsers: ...
Read now
Unlock full access