Move scroll bar to first row when clicking next/ previous - datatables

Move scroll bar to first row when clicking next/ previous - datatables

bbaranibbarani Posts: 32Questions: 0Answers: 0
edited January 2013 in DataTables 1.9
I am using datatables for displaying data in grid, everything works fine except for one issue (cosmetic issue).

When users go to end of page 1(now the scroll bar is at the end of the grid) and when they click any of the pagination button (next / previous / first / last), the scroll bar doesnt go back to top instead it stays same position where it was in previous page. Is there a way to reset the scrollbar position?

Thanks,
Barani

Replies

  • bbaranibbarani Posts: 32Questions: 0Answers: 0
    Can anyone provide me with any suggestion??

    I tried the below suggestion, but doesn't seem to work....

    $("#"+elementId+"_last").click(function(){
    window.scrollTo(0, $('#'+elementId).offset().top)

    });

    $("#"+elementId+"_first").click(function(){
    window.scrollTo(0, $('#'+elementId).offset().top)
    });
This discussion has been closed.