Always start showing view from top position

2 posts, 1 answers
  1. Yrjo
    Yrjo avatar
    11 posts
    Member since:
    Aug 2012

    Posted 06 Jan 2013 Link to this post

    How can prevent my views remember their previous scroll position? If I scroll down in one view, then go to another and back again, the first view starts from the scrolled position. This is a natural way in browsers, but I would like to force my view always start in the top position. I can't figure out how to make this happen.

    I tried to add a data-before-show="gotoTop" in my views and then adding in kendo initialization this block function

    var app = new;
    gotoTop() { $('body').scrollTop();
    but it does not seem to work. I am quite new to Kendo, so I appreciate any suggestions or help, thanks!
  2. Answer
    Kamen Bundev
    Kamen Bundev avatar
    1532 posts

    Posted 07 Jan 2013 Link to this post

    Hi Yrjo,

    You can use the Mobile Scroller's reset method to scroll to the page top on view show or beforeshow - you can obtain the View's Mobile Scroller using e.view.scroller, like this:
    function gotoTop(e) {

    Kamen Bundev
    the Telerik team
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Back to Top