This is a migrated thread and some comments may be shown as answers.

Endless-scrolling List view, scroll to top

7 Answers 357 Views
ListView (Mobile)
This is a migrated thread and some comments may be shown as answers.
Dean
Top achievements
Rank 1
Dean asked on 16 Sep 2013, 02:56 AM
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

7 Answers, 1 is accepted

Sort by
0
Accepted
Kiril Nikolov
Telerik team
answered on 16 Sep 2013, 02:07 PM
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!
0
Accepted
Przemek
Top achievements
Rank 1
answered on 17 Sep 2013, 10:35 AM
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.
0
Kiril Nikolov
Telerik team
answered on 17 Sep 2013, 11:41 AM
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!
0
Dean
Top achievements
Rank 1
answered on 22 Nov 2013, 03:47 AM
Has this been resolved?
0
Petyo
Telerik team
answered on 25 Nov 2013, 11:37 AM
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!
0
Dean
Top achievements
Rank 1
answered on 25 Nov 2013, 10:24 PM
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;
0
Petyo
Telerik team
answered on 27 Nov 2013, 09:01 AM
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!
Tags
ListView (Mobile)
Asked by
Dean
Top achievements
Rank 1
Answers by
Kiril Nikolov
Telerik team
Przemek
Top achievements
Rank 1
Dean
Top achievements
Rank 1
Petyo
Telerik team
Share this question
or