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

Scroll to item in ListView (Mobile) with endlessScroll

3 Answers 148 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Nicola
Top achievements
Rank 1
Nicola asked on 20 Sep 2014, 02:19 PM
For a navigation menu like iPhone alphabet -scroller on contact's list, I need to scroll the listview down to a particular item. The alphabet-scroller scroll down through the list of contacts depending on which letter is selected with the finger.
Since with endlessScroll the paging is virtual, they are displayed only some of the #pagesize items loaded by the datasource. I calculate the correct page of the datasource to read based on the count of items for each letter (ex. with a pagesize of 50 item, the 121st item is on page 3) . The problem is that I have to scroll through the listview in order to position the first name with the chosen letter in the  the first line. I've tried using scrollTo and it works but only for items that are actually on the html page. Indeed, the other item (up to the PageSize) are insert on the page only when the listview scroll down. I can't use a filter, because I can't scroll forward and back using directly the listview.
Is there a scrollToItem solution ? Or how can I say programmatically to the list that I'm scrolling  and that it should display the following items ?

Thanks !
Nicola

3 Answers, 1 is accepted

Sort by
0
Accepted
Kiril Nikolov
Telerik team
answered on 22 Sep 2014, 08:34 AM
Hi Nicola,

The scrollTo() method will not work for items that are not loaded in the DOM. And this behavior is in some way expected - cannot scroll to an element that does not exists. I am afraid that currently there is no workaround that I can offer to you. If you do not have a large data subset, then you can just turn off the virtualization and use the scrollTo() method freely.

Regards,
Kiril Nikolov
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Nicola
Top achievements
Rank 1
answered on 22 Sep 2014, 09:50 AM
Hi Kiril,
thanks for now, I will search an alternatite solution for navigation.

Regards,
Nicola
0
Kiril Nikolov
Telerik team
answered on 22 Sep 2014, 09:51 AM
Hi Nicola,

In case you have any other questions, please do not hesitate to contact us.

Regards,
Kiril Nikolov
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
General Discussions
Asked by
Nicola
Top achievements
Rank 1
Answers by
Kiril Nikolov
Telerik team
Nicola
Top achievements
Rank 1
Share this question
or