Jump to specific page when we go back to page #1763
Unanswered
2020aipooja
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
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"
Beta Was this translation helpful? Give feedback.
All reactions