Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Maintaining Pagination after leaving the page and returning #204

Open
MibenCoop opened this issue Jun 17, 2019 · 5 comments
Open

Maintaining Pagination after leaving the page and returning #204

MibenCoop opened this issue Jun 17, 2019 · 5 comments

Comments

@MibenCoop
Copy link
Contributor

Overview
When returning to a page [with pagination] the page needs to automatically return to the specific page within the set of pages displayed on the page. IE. If a user leaves the screen is on Page 3 and clicks the "back" button, the user should land back on Page 3, not Page 1.

Description
Current Behavior: When a user is on a page with pagination [pagination greater than or equal to the second page, Page X] and moves away from that page via a link, and then returns to that same URL, the user is returned to Page 1 instead of Page X

Desired Behavior: When a user is on a page with pagination [pagination greater than or equal to the second page, Page X] and moves away from that page via a link, and then returns to that same URL, the user is returned to Page X.

Use Cases

  • Improved user experience
@DonMartin76
Copy link
Member

@santokhsingh This is related to what you were referring to the other day with the use of the "back" button, isn't it? Can we use fragment parameters which we inject when clicking in the grid for example?

@DonMartin76
Copy link
Member

@santokhsingh @MibenCoop Was this already done? If so, it's in 1.0.0-rc.8.

@santokhsingh
Copy link
Collaborator

@DonMartin76 This is not done yet.

@DonMartin76
Copy link
Member

So, I just realized that just going back after clicking on a link and then just returning via the history "back" button works as you would expect - you are still on the same page. What is the actual use case here? Copy/pasting the URL, going somewhere else, and then coming back via a pasting the URL, and expecting that the correct page is still active?

@DonMartin76
Copy link
Member

The following approach should work in any case:

  • When a page is loaded, a filter is used, or sorting is change, store that in the fragment of the URL, like this:
windows.location.hash = `page=${page},sort=${sort},filter=${filter}`;

Then in your HTML page, when it loads, you can retrieve the fragment by retrieving the same window.location.hash and parsing it, to prime the loading of the JSgrid with those parameters.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants