Scroll position after going to new page

Scroll position after going to new page

bobonwhidbeybobonwhidbey Posts: 1Questions: 0Answers: 0
edited May 2013 in Feature requests
I'm using DataTables in conjunction with TablePress at http://blog.chriswspencer.com/

After the user presses "Next" or "Previous" to view another page in the table, the scroll bar for the web page remains unchanged....normally at the bottom of the page.

It would be preferable if the vertical scrollbar were positioned so that the top of the table is visible. When you turn a page, your eye wants to be at the top of the next (or previous) page.

Is this possible with DataTables.

Replies

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    The page's scrollbar or DataTables scrollbar? If the latter, it should already be doing that (it will only show a scroll bar if you have scrolling enabled).

    For the page, you'd need to add an event listener to the buttons which will jump the page's scrolling. This isn't something that I'll put into DataTables core, but it could readily be done as a plug-in.

    Allan
This discussion has been closed.