How to prevent the page jumping to top when sorting
How to prevent the page jumping to top when sorting
islamelshobokshy
Posts: 99Questions: 20Answers: 1
As the header says, when I sort, the page goes to the top each and every time, how can I prevent that, so it would sort and stay where it is?
This discussion has been closed.
Replies
I'm bumping this, as there are no other discussions talking about it with a reply
Take a look at this thread here - it's not possible to do...
Cheers,
Colin
My problem is not going to the first page (as I do not have any pagination anyway). My problem is that if I scroll a little bit, and then click on sort, the page itself goes to the top, and doesn't stay a bit scrolled. Do you know what I mean?
I think the problem comes from the fact when I sort, the
processing: true
redraws my table, and thus scrolling the page to the top.We're happy to take a look if you can provide a working example demonstrating the problem,
Cheers,
Colin
I found the answer, I'll put it here for reference. You should add this to your datatables to save the current scroll position before redrawing it :