using primeng virtual scroll table in angular to handle huge set of data [array], here i want to use
scrollToIndex is there any thing like cdk-virtual-scroll-viewport in primeng table, if user clicks on a button I need to scroll to a particular index (eg 100)
<div class="log-console-parent" #logsParentDiv (wheel)="onUserScroll()">
<p-table [columns]="cols" [value]="getFilteredLogs()" [scrollable]="true" [rows]="100" scrollHeight="flex"
[virtualScroll]="true" [virtualRowHeight]="27">
<ng-template pTemplate="body" let-rowData let-rowIndex="rowIndex" let-columns="columns">
<tr>
<td>
<span [innerHTML]="rowData.message"></span>
</td>
</tr>
</ng-template>
</p-table>
</div>
versions : angular: 12, primeng: 12
Yes, it is possible.
p-tablecomponent will let you usescrollToVirtualIndexmethod. Reference: https://www.primefaces.org/primeng-v12-lts/#/table (down to "Methods" part).Example code:
*.component..html
*.component.ts