Ngx-datatable: How to navigate to page programmatically ?

Created on 19 Jan 2017  路  3Comments  路  Source: swimlane/ngx-datatable

I'm submitting a ...
[X] feature request

Current behavior
When adding rows, the newly added row may be added in the next page.
Also, when filtering rows, the table stays on the same page, so it might be empty.
need a way to change pages on such events.

Expected behavior
need a method to paginate.

Reproduction of the problem
try to add a row when reaching the row limit.
the new row is added to the next page.

try to filter rows in page >1
if the filtered rows are less than the limit*pages, the table looks empty.
need a way to paginate to first page.

What is the motivation / use case for changing the behavior?
the ability to paginate programmatically when adding / removing rows.

Please tell us about your environment:
latest

  • Table version: 0.7.x
    5.0.0

  • Angular version: 2.0.x
    latest

  • Browser: [all | Chrome XX | Firefox XX | IE XX | Safari XX | Mobile Chrome XX | Android X.X Web Browser | iOS XX Safari | iOS XX UIWebView | iOS XX WKWebView ]
    all

  • Language: [all | TypeScript X.X | ES6/7 | ES5]
    all

Question Working as Intended

Most helpful comment

This can be done currently by grabbing ahold of the DatatableComponent and manually setting the offset.

Take a look at an example here

See discussion on the topic here

All 3 comments

This can be done currently by grabbing ahold of the DatatableComponent and manually setting the offset.

Take a look at an example here

See discussion on the topic here

For me didn't work to setting the offset manually, instead I used table.bodyComponent.updateOffsetY(0); to navigate on the first page.

See line here:
https://github.com/swimlane/ngx-datatable/blob/master/src/components/datatable.component.ts#L847

I have the same issue. I setup a listener to detect tabs (https://stackoverflow.com/questions/50187302/how-do-you-programmatically-focus-on-a-column-row-in-ngx-datatable/50189278#50189278), then add a new row and focus on the first column of the new row. My issue now is that when the user is on the last row of the page before new page, it creates the new row in the next page but I can't get the user programmatically to go to the next page

The offset comment here doesn't help me programmatically take the user to the new page that was generated. Any other advice please?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ExTheSea picture ExTheSea  路  3Comments

DethAriel picture DethAriel  路  3Comments

JanStock picture JanStock  路  3Comments

Csirme picture Csirme  路  3Comments

iget-esoares picture iget-esoares  路  3Comments