Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to integrate Primeng datatable with ngx-infinite-scroll

I am trying to integrate ngx-infinite scroll library https://www.npmjs.com/package/ngx-infinite-scroll

with a primeng grid

https://www.primefaces.org/primeng-4.3.0/#/datatable

Has anyone tried to integrate those together or any other datatable.

like image 379
josh_boaz Avatar asked Sep 13 '25 03:09

josh_boaz


1 Answers

I know this is old, but just in case some one wanted the same functionality, just use the infiniteScrollContainer on the parent element of the p-table or the p-table and provide the class of .p-datatable-wrapper as a value, it's the scrollable container of the table, as the following:

<div
  class="p-3"
  infiniteScroll
  [infiniteScrollDistance]="2"
  [infiniteScrollThrottle]="50"
  (scrolled)="loadData()"
  [infiniteScrollContainer]="'.p-datatable-wrapper'"  
  [scrollWindow]="false"
  appScrollTopOn
>
  <p-table> </p-table>
</div>
like image 182
Mohamed AbdulRaouf Avatar answered Sep 15 '25 17:09

Mohamed AbdulRaouf