Page initialization
See original GitHub issueI’m submitting a …
[ ] bug report => search github for a similar issue or PR before submitting
[x ] feature request
[ ] support request => Please do not submit support request here, post on Stackoverflow or Gitter
Current behavior N/A
Expected behavior Set the page number / initialize with a page number
Reproduction of the problem N/A
What is the motivation / use case for changing the behavior? Would be incredibly useful to be able to set the starting page of the component. I have a use case that stores various pagination settings across the lifecycle of the app, and returning to a page should restore the pagination to the state it was previously at. (I’m using server side pagination). However as far as I can tell (please correct me if I’m wrong), this is not currently possible.
UPDATE:
I’m using server side pagination externalPaging
, which works fine, and calls the page
output as appropriate, which works fine. What I need to do is get into the table, an initial page number, such that the pagination control is initialised with this page visually. Currently if I set the start page and provide the table with the correct data, the paging control still will show page 1. I cannot see a way to initialise this paging control. There is no page
input… Forgive me if I’m missing something obvious.
UPDATE WITH EXAMPLE:
As a crude example: plnkr
In this example pagination is emulated given the example company dataset.
I’m using externalPaging
.
I’m attempting to demonstrate that if I initialize my page to 2 (1 zero indexed), and use this to retrieve the data, the correct data for page 2 is displayed, but that there is no way to initialize the page number in the pagination control to match this. There is no page number input. So if you click on page 2, you’ll notice the content doesn’t change: this is because it was already showing the data from page 2, but now show’s page 2 itself having invoked (page)
.
Please tell us about your environment: N/A
-
Table version: 9.3.1
-
Angular version: 4.1.2
-
Browser: [all]
-
Language: [all]
Issue Analytics
- State:
- Created 6 years ago
- Comments:6 (2 by maintainers)
Top GitHub Comments
Greetings! Any update on this? I also need sometimes to go back to the view displaying the datatable and it would be great to be able to “restore” its state. Currently all I can do is to pass an ‘offset’ input variable and it seems to correctly set page number in the pagination but the table itself doesn’t scroll to correct page. Did anyone find any workaround for this?
@amcdnl updated description with plunker example