DataTable: Scroll to selected row
-
- Posts: 11
- Joined: 20 Sep 2016, 10:16
I hope this example give you an idea.
HTML:
TS:
HTML:
Code: Select all
<p-dataTable
(onRowDblclick)="onRowDblclick($event)"
[value]="workflows$ | async"
[(selection)]="this.selectedWorkflow"
selectionMode="single"
...
...
Code: Select all
ngOnInit() {
this.workflows$ = this.houseKeepingService.getWorkflowsByPrefix(this.prefix);
}
ngOnChanges() {
this.workflows$.subscribe(workflows => {
let found: boolean = false;
workflows.forEach(workflow => {
if (!found && workflow.uuid === this.uuid) {
this.selectedWorkflow = workflow;
found = true;
}
}
}
-
- Posts: 3
- Joined: 11 Jul 2017, 10:28
Hi Joshua,
This is selecting/ highlighting the selected row on the grid.
But how can I make the vertical scroll work so that automatically grid can scroll to the selected row ?
Thank you.
This is selecting/ highlighting the selected row on the grid.
But how can I make the vertical scroll work so that automatically grid can scroll to the selected row ?
Thank you.
-
- Posts: 11
- Joined: 20 Sep 2016, 10:16
Sorry for the late response but is it possible to use:
(onPageChange)="paginate($event)" and then calculate on which page? I also think this is new functionality.
(onPageChange)="paginate($event)" and then calculate on which page? I also think this is new functionality.
-
- Information
-
Who is online
Users browsing this forum: No registered users and 18 guests