problem on Pagination (2nd page only)

There is a weird issue that is happening in my project in my p-table, Pagination works well except when i'm trying to get to the 2nd page, on that case it calls to the "onLazyLoad" event twice: first time with the right parameters (rows,first) , the 2nd time it calls with (rows,first) that rout to the first page (same happening with the arrows of the paginator from 1st page to 2nd page and also from 3rd page to the 2nd) happens only on that case means that i cannot get the 2 page ever!

<p-table datakey="Id"
     [loading]="loading"
     [value]="games"
     [paginator]="true"
     [rows]="20"
     [rowsPerPageOptions]="[5,10,20]"
     [lazy]="true"
     (onLazyLoad)="loadGamesLazy($event)"
     [totalRecords]="gamesCount"
     responsive="true"
     [filters]="filterForm.value"
     >

loadGamesLazy(event: any) {
setTimeout(() => {
  this.lazyGames.emit(event);
}, 0);

}

0 Answers