Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
This repository was archived by the owner on Feb 2, 2025. It is now read-only.

Jump to specific page when we go back to page #1763

Unanswered
2020aipooja asked this question in Q&A
Discussion options

Hello,

I'm utilizing Angular Datatables in my Angular project (Angular v14.2.0). My requirement is to save the state of the selected page in localStorage and jump to that page when revisiting it.

The issue arises when attempting to jump to a specific page with a larger amount of data, such as 50 or 100 records per page. In this case, the page is not set to the stored page number.

initComplete: (settings, json) => {
setTimeout(() => {
var api = new $.fn.dataTable.Api( settings );
var page = parseInt(localStorage.getItem('selected_page')) ? parseInt(localStorage.getItem('selected_page')) : 0;
api.page(page).draw(false);
}, 3500);
},

Here are the details:
"@angular/common": "^14.2.0",
"@angular/compiler": "^14.2.0",
"@angular/core": "^14.2.0"

"angular-datatables": "^16.0.0",
"bootstrap": "^5.3.2",
"bs-stepper": "^1.7.0",
"datatables.net": "^1.13.6",
"datatables.net-bs4": "^1.13.6",
"datatables.net-buttons": "^2.4.2",
"datatables.net-buttons-dt": "^2.4.2",
"datatables.net-dt": "^1.13.6",
"datatables.net-responsive": "^2.5.0",
"datatables.net-responsive-dt": "^2.5.0"

You must be logged in to vote

Replies: 0 comments

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
🙏
Q&A
Labels
None yet
1 participant
Morty Proxy This is a proxified and sanitized view of the page, visit original site.