Not Able to use VirtualScroll Pagination After Performing server side Sorting.

UI Components for Angular
Post Reply
Posts: 2
Joined: 23 Sep 2022, 09:15

27 Sep 2022, 11:09

Here is my HTML Code:
``` <p-table styleClass="p-datatable-sm" *ngIf="showTable" [columns]="cols" [value]="dataList"
[scrollable]="true" responsiveLayout="scroll" dataKey="" [(selection)]="selectedList"
[rows]="limit" scrollHeight="250px" [virtualScroll]="true" [virtualRowHeight]="30"
selectionMode="single" (onRowSelect)="onRowSelect($event)" [lazy]="isLazy"
(onLazyLoad)="loadDataOnLazy($event)" [totalRecords]="totalRecords">

<ng-template pTemplate="header" let-columns>
<th *ngFor="let col of columns" [pSortableColumn]="col.field"
{{col.header}} <span *ngIf="col.isDisabled === false">
<p-sortIcon [field]="col.field"></p-sortIcon>
<ng-template pTemplate="body" let-rowData let-columns="columns">
<tr [pSelectableRow]="rowData">
<td *ngFor="let col of columns" [ngClass]="[col.classNames]" class="multiLineQuery">

Here is my ts Code:
loadDataOnLazy(event: LazyLoadEvent) {
this.sortColumn = event.sortField;
event.sortOrder == 1 ? (this.sortOrder = 'ASC') : (this.sortOrder = 'DESC');

if (!this.loadingSearch && this.utility.isNullorUndefined(this.sortColumn)) {
console.log('insdie') + PAGINATION_LIMIT);
if (!this.utility.isNullorUndefined(this.sortColumn) && this.loadingSearch) {
console.log('out side');


Using PrimeNG Version - 13 Please suggest me if any solution

Post Reply

Return to “PrimeNG”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 7 guests