DataTable: Scroll to selected row

UI Components for Angular
Post Reply
loebe
Posts: 7
Joined: 02 Aug 2016, 20:05

11 Oct 2016, 21:30

Is there a possibility to automatically scroll to the selected row after [(selection)]="..." changed?

mmlitvin
Posts: 6
Joined: 25 Oct 2016, 23:54

06 Dec 2016, 16:28

I have a similar problem to solve. Once a new row added to the table it would be expected to scroll to the bottom of the table to the newly added row. How can it be done ?
Thank you

mohanr.k
Posts: 19
Joined: 23 Dec 2016, 00:42

03 Feb 2017, 06:30

Hi

Could you please help me if you have got solution for the issue reported here.

enjoi2349
Posts: 7
Joined: 29 Dec 2017, 15:49

15 Feb 2018, 16:28

Hello,

Also looking for this solution if anyone has come across one yet.

Thanks

jgilli01
Posts: 9
Joined: 09 Feb 2017, 16:47

26 Feb 2018, 21:53

I'd like to bump this one, this would be a real nice to have.

JoshuaTree
Posts: 11
Joined: 20 Sep 2016, 10:16

27 Feb 2018, 16:14

I hope this example give you an idea.

HTML:

Code: Select all

 <p-dataTable
        (onRowDblclick)="onRowDblclick($event)"
        [value]="workflows$ | async"
        [(selection)]="this.selectedWorkflow"
        selectionMode="single"
        ...
        ...
TS:

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;
            }
         }
  }

jagath.jayasinghe
Posts: 3
Joined: 11 Jul 2017, 10:28

23 Apr 2018, 16:38

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.

JoshuaTree
Posts: 11
Joined: 20 Sep 2016, 10:16

30 May 2018, 11:36

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.

Post Reply

Return to “PrimeNG”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 18 guests