core/common/virtual-scroll/virtual-scroller-wrapper.component.ts
selector | c8y-virtual-scroller-wrapper |
templateUrl | ./virtual-scroller-wrapper.component.html |
Properties |
Methods |
Inputs |
containerHeight |
Type : any
|
filterPipe |
Type : any
|
Default value : pipe(tap())
|
itemHeight |
Type : any
|
items |
Type : any
|
strategy |
Type : "fixed" | "window"
|
template |
Type : TemplateRef<any>
|
trackByFn |
Type : (i: any, item: any) => any
|
Default value : (i, item) => {
return item.id;
}
|
apply |
apply()
|
Returns :
void
|
items$ |
Type : Observable<>
|
<ng-container *ngIf="items$ |async as items" [ngSwitch]="strategy">
<ng-container *ngSwitchCase="'window'">
<cdk-virtual-scroll-viewport windowVirtualScrollStrategy [itemSizePx]="itemHeight">
<div *cdkVirtualFor="let item of items; index as i; trackBy: trackByFn">
<ng-container *ngTemplateOutlet="template; context: {$implicit: item, index: i}"></ng-container>
</div>
</cdk-virtual-scroll-viewport>
</ng-container>
<ng-container *ngSwitchCase="'fixed'">
<cdk-virtual-scroll-viewport [itemSize]="itemHeight" [style.height]="containerHeight + 'px'">
<div *cdkVirtualFor="let item of items; index as i; trackBy: trackByFn" >
<ng-container *ngTemplateOutlet="template; context: {$implicit: item, index: i}"></ng-container>
</div>
</cdk-virtual-scroll-viewport>
</ng-container>
</ng-container>