I'm trying to make the p-table scrollbar scroll to a certain position. It doesn't seem to do anything at all. Here's my code:
ngAfterViewInit(): void {
this.table.scrollTo({'top': 200})
}
"this.table" is
@ViewChild('dt', {static: false}) public table: Table;
and in the template file it is defined this way:
<p-table #dt
[value]="items"
class="ui-rtl"
[styleClass]="styleClass"
[scrollable]="true"
[columns]="columns"
scrollHeight="790px"
dir="rtl">
Ignore to hard coded numbers, I'm only trying to figure out how to make it work for now.
Does anyone know how to use it? The documentation says:
options.top: Specifies the number of pixels along the Y axis
I have tried to pass as argument both {'options.top':200} and {top:200} but nothing happens.
Any help will be highly appreciated!
Thank you