Maintain Scroll Position?

4 posts, 0 answers
  1. Dave
    Dave avatar
    2 posts
    Member since:
    Mar 2014

    Posted 17 Sep 2014 Link to this post

    I have a view on the main page of our Telerik Platform application with a list of RSS feeds.  The view contains over 70 feeds, so you can scroll down quite a bit to view all of the feeds.  When you click into a feed, you navigate to a new view that shows all of the posts for that feed.

    I have a backbutton at the top of the feed items view to go back to the homepage.  When clicked it does go back to the original view, but it doesn't maintain the scroll position they were at.  So if they had scrolled all the way to the bottom, then now have to scroll all the way to the bottom again to pick up where they left off.

    Anyone dealt with anything like this and have a solution?  I didn't see anything in the documentation, so I'm not sure that it's baked right in to the product?  I've done something similar on the web where we trap for the position on click, then put that somewhere, then we can set the scroll y position when we come back, but was hoping to avoid that much overkill just to try and maintain where they were.
  2. Tina Stancheva
    Tina Stancheva avatar
    3299 posts

    Posted 22 Sep 2014 Link to this post

    Hello Dave,

    I will post here the same information I sent as a reply in your support ticket. We need more information about the implementation of the described scenario in order to advise you how to keep the scroll position.

    However, generally if you're using Kendo UI Mobile widgets, such as the ListView, you need to have in mind that if the widget is destroyed (reinitialized), it cannot keep its scroll position.

    Tina Stancheva

    Visit the Telerik Verified Plugins Marketplace and get the custom Cordova plugin you need, already tweaked to work seamlessly with AppBuilder.

  3. Dave
    Dave avatar
    2 posts
    Member since:
    Mar 2014

    Posted 25 Sep 2014 in reply to Tina Stancheva Link to this post

    I am using a listview and I have the data-role attribute setting it up.  Is that going to reinitialize every time the view is displayed?  If so then I probably need to initialize it manually in the javascript?

    <div id="drawer-home" data-role="view" data-layout="drawer-layout" data-title="Plug-N-Run News"
            data-model="app.pnrfeedsService.viewModel" data-show="FeedsShow" autobind="false">
           <header data-role="header">
               <div data-role="navbar">
                   <span data-role="view-title"></span>
                   <a data-role="button" data-rel="drawer" href="#my-drawer" data-icon="drawer-button" data-align="left"></a>
           <ul data-role="listview" data-style="inset" data-selectable="single" id="ulFeeds"
               data-bind="source: pnrfeedsDataSource"
       <script id="pnr-feeds-template" type="text/x-kendo-tmpl">
           <div style="padding-left: 8px; padding-right: 8px;">
               <a href="views/feeditems.html?FeedId=#:FeedId#" class="km-listview-link" data-role="listview-link">
                   <img src="styles/icons/${ImageName}" />
  4. Kiril Nikolov
    Kiril Nikolov avatar
    2598 posts

    Posted 30 Sep 2014 Link to this post

    Hi Dave,

    Would you please provide a runnable sample where the issue is reproduced, so we can take a look. The same issue cannot be reproduced in our online demos, so we are not able to tell you what exactly is wrong in your project.

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