Pagination:scroll to top?

Hi,
I’ve noticed that after clicking on a link in the pagination area the browser does not jump to the top after loading the next page. It loads the second page but each time the user has to scroll up again.

I could write same js-stuff, but I thought there probably is a solution for this behaviour?

thanks in advance!

1 Like

it was relatively easy to do scroll top on gridview udpate in yii1, yii2 uses pjax for updating the gridview content so you have to register an event to pjax something like

$(document).on('pjax:success', function() {
    $("html, body").animate({ scrollTop: $("#gridview-id").position().top }, 300);
});
2 Likes