Endless-scrolling List view, scroll to top

8 posts, 2 answers
  1. Dean
    Dean avatar
    73 posts
    Member since:
    Oct 2012

    Posted 15 Sep 2013 Link to this post

    How can I scroll a list view with endless-scrolling="true" to the top? I tried this:
    app.view().scroller.reset();
    and it works to a point. The view scrolls to the top, but the list appears to be empty and any inertia continues to scroll the page down.

    I don't have access to the particular list element as I'm trying to apply a generic function that works on every view no matter if there is a list view or not.

    Cheers
    Dean
  2. Answer
    Kiril Nikolov
    Admin
    Kiril Nikolov avatar
    2566 posts

    Posted 16 Sep 2013 Link to this post

    Hi Dean,

    Thank you very much for bringing this to our attention.

    This is a bug in the ListView related to the endlessScrolling implementation of the widget. I have logged this in our internal bug tracker, so it will be fixed.

    As a small gesture of gratitude I have updated your Telerik Points Balance.
     
    Regards,
    Kiril Nikolov
    Telerik
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  3. Kendo UI is VS 2017 Ready
  4. Answer
    Przemek
    Przemek avatar
    2 posts
    Member since:
    Mar 2013

    Posted 17 Sep 2013 Link to this post

    Just as a workaround for a time when fix is not ready you may reset a listview with endless scroll enabled by calling:
    kendoListView._itemBinder.buffer.range(0);
    kendoListView._itemBinder.list.refresh();
    pane.view().scroller.reset();

    Kiril, could you please update this topic once the bug will be fixed and available in internal builds? I will then remove the workaround from our app.
  5. Kiril Nikolov
    Admin
    Kiril Nikolov avatar
    2566 posts

    Posted 17 Sep 2013 Link to this post

    Hi Przemek,

    Thank you very much for sharing your workaround. 

    I will make sure that the forum topic is updated when the issue is resolved, so you can remove the workaround from your application.

    Thank you again for your cooperation.
     
    Regards,
    Kiril Nikolov
    Telerik
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  6. Dean
    Dean avatar
    73 posts
    Member since:
    Oct 2012

    Posted 21 Nov 2013 Link to this post

    Has this been resolved?
  7. Petyo
    Admin
    Petyo avatar
    2439 posts

    Posted 25 Nov 2013 Link to this post

    Hi Dean,

    Thank you for re-opening this thread. With Q3, the correct way to implement this behavior would be to reset the scroller, and move the dataSource page to 0. Please check this jsbin for a runnable example.

    Regards,
    Petyo
    Telerik
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  8. Dean
    Dean avatar
    73 posts
    Member since:
    Oct 2012

    Posted 25 Nov 2013 Link to this post

    Thanks Petyo.

    I don't know if there is a better way to do this, but I added the following line so that the list doesn't continue scrolling from the top.

    listView.scroller().yinertia.velocity = 0;
  9. Petyo
    Admin
    Petyo avatar
    2439 posts

    Posted 27 Nov 2013 Link to this post

    Hi Dean,

    although undocumented, this is a viable approach. Keep in mind that it may not function in future releases. The "proper" way here would be to expose the scroller elastic scrolling configuration option at the view level - I am logging this as a feature. 

    Regards,
    Petyo
    Telerik
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Back to Top
Kendo UI is VS 2017 Ready