Skip to content

Commit

Permalink
Fixed #9154 - Sort and Filter support for VirtualScrolling
Browse files Browse the repository at this point in the history
  • Loading branch information
cagataycivici committed Sep 2, 2020
1 parent 361cc5e commit 84a1275
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/app/components/table/table.ts
Original file line number Diff line number Diff line change
Expand Up @@ -790,6 +790,8 @@ export class Table implements OnInit, AfterViewInit, AfterContentInit, Blockable

return (this.sortOrder * result);
});

this._value = [...this.value];
}

if (this.hasFilter()) {
Expand Down Expand Up @@ -824,6 +826,8 @@ export class Table implements OnInit, AfterViewInit, AfterContentInit, Blockable
this.value.sort((data1, data2) => {
return this.multisortField(data1, data2, this.multiSortMeta, 0);
});

this._value = [...this.value];
}

if (this.hasFilter()) {
Expand Down Expand Up @@ -2191,7 +2195,7 @@ export class Table implements OnInit, AfterViewInit, AfterContentInit, Blockable
</ng-template>
</ng-container>
<ng-container *ngIf="!dt.expandedRowTemplate && dt.virtualScroll">
<ng-template cdkVirtualFor let-rowData let-rowIndex="index" [cdkVirtualForOf]="dt.value" [cdkVirtualForTrackBy]="dt.rowTrackBy" [cdkVirtualForTemplateCacheSize]="0">
<ng-template cdkVirtualFor let-rowData let-rowIndex="index" [cdkVirtualForOf]="dt.filteredValue||dt.value" [cdkVirtualForTrackBy]="dt.rowTrackBy" [cdkVirtualForTemplateCacheSize]="0">
<ng-container *ngTemplateOutlet="rowData ? template: dt.loadingBodyTemplate; context: {$implicit: rowData, rowIndex: dt.paginator ? (dt.first + rowIndex) : rowIndex, columns: columns, editing: (dt.editMode === 'row' && dt.isRowEditing(rowData))}"></ng-container>
</ng-template>
</ng-container>
Expand Down

0 comments on commit 84a1275

Please sign in to comment.