I have implemented lazyload on my primeng-table,
<p-table #dataTable [columns]="tableHeader" [value]="tableData" [rows]="10" [paginator]="true"
[rowsPerPageOptions]="rowsPerPage" [totalRecords]="totalRecords" [sortField]="sortField" [sortOrder]="sortType"
rowHover="true" [lazy]=true (onLazyLoad)="loadLazy($event)">
And user can change the column by value selection (it is handled by API call). The problem is, If I update the sortField and sortOrder API is triggering two times.
this.dataTable.sortField = obj.sortField;
this.dataTable.sortOrder = obj.sortType;
this.loadTableData(); // this method is triggered to fetch the API data.
With the above code, I don't want to trigger the loadLazy method for multiple times.
So, I have tried the following code,
this.dataTable.lazy = false;
this.dataTable.sortField = obj.sortField;
this.dataTable.sortOrder = obj.sortType;
this.loadTableData(); // this method is triggered to fetch the API data.
this.dataTable.lazy = true;
But if I set the lazy to false and true, the pagination is not showing up.? could you guys suggest me where I am making the problem.?