document.location after pressing pagination button
document.location after pressing pagination button
tardigrad
Posts: 9Questions: 4Answers: 0
When I click a pagination button in my datatable, the page stays at the bottom of the table (I should have said that the pagination buttons are at the bottom).
I made this function to force it back to the top, but it's not working, it only jumps a little bit up, but not to the top.
function paginateScroll() {
document.location.href = "#header-row";
// console.log('pagination button clicked');
$('.paginate_button').unbind('click', paginateScroll);
$('.paginate_button').bind('click', paginateScroll);
}
paginateScroll();
I'm using chrome.
I see it works perfectly in Firefox.
This discussion has been closed.
Answers
it's a timer problem because this works in chrome:
Super - thanks for sharing this with us! I'm sure others will find it useful.
Allan
I just found a better solution that doesn't write a hash in the url and works in chrome without need to delay
For the record here is everything I tried