Declined
Last Updated: 14 Oct 2021 11:08 by ADMIN
Don
Created on: 25 Feb 2014 23:09
Category: Kendo UI for jQuery
Type: Feature Request
4
Ability to start the ListView at any point in a ListView when endlessScroll is on.
When you have a ListView that can show thousands of records (presumably using a remote dataSource), it would be very useful to be able to start at a given point in the list, rather than having to start at the top of the list and scroll down thousands of records to get to the point you want.

This is currently possible to do when you have a ListView with set number of records that are all displayed at once by using the view's .scrollTo() function, but not possible when endlessScroll is on on the ListView.

Here is my original support ticket and the response I received regarding this matter:

<BEGIN MY SUPPORT TICKET>
I have a ListView which has a remote dataSource.  EndlessScroll is on in the ListView.  That part works as expected.  However, at times I need to programmatically "scrollTo" a particular point in the ListView.  To do this, I call .scrollTo() on the view's scroller (e.g. $('#MyView').data('kendoMobileView').scroller.scrollTo(0, -725)).  If I .scrollTo() a point that is too far down the page, sometimes the data doesn't show or only a couple of records/rows show and the "loading" icon is beneath them.  Here is an example of what I mean.

Given that we have a ListView with endlessScrolling on to which is attached a dataSource that reads from a remote url and has a pageSize of 50.  If we .scrollTo() about 25% down the list (approximately 13 rows down), everything works fine (i.e. after the .scrollTo() completes, we are at the row we want and all the records are there).  However, if instead of 25% we .scrollTo() about 60% down (approximately row 30), none or only some of the records with a spinning "loading" icon will be visible.

Based off of what I read here http://docs.telerik.com/kendo-ui/getting-started/mobile/listview#press-to-load-more-/-endless-scrolling, I believe what is happening is that since the ListView "adds" more of the records from the page that was retrieved from the dataSource as you scroll down the list when in virtual mode, if we .scrollTo() too far down the page, the ListView isn't smart enough to know to "add more" rows to the DOM and also make a call to the next page of the dataSource if it is necessary.  Basically, I believe ".scrollTo()" needs to trigger the ListView to add to the DOM and make a call to the next page of the dataSource the same way that scrolling with your finger would do.

I hope there is a solution/fix/hack to this because I have spent many hours on this.
<END MY SUPPORT TICKET>


<BEGIN TELERIK'S RESPONSE>
Thank you very much for the detailed information.

I am afraid that when the ListView is used in "endless scrolling" mode the scrollTo() method will not work as expected. The main idea behind the endless scrolling functionality is to load records on demand and load only the elements that the user wants to see, this is why the elements displayed are constantly changed as new items are loaded.

Currently there is not a workaround that I can offer. If you really want to see this functionality added in the future I would suggest you to check our uservoice section, where you can post this as a feature request, so it will be considered for a future implementation.
<END TELERIK'S RESPONSE>
2 comments
Don
Posted on: 06 Mar 2014 16:21
If this is implemented, please make sure that the ability to scroll up from a given point in the list works properly.  It does not work properly now.  For details, see http://www.telerik.com/forums/scrolling-up-in-a-listview-with-endlessscroll-skips-to-the-start-of-the-last-page#cXoyHJzFcU-86rNCzDRPjw
Don
Posted on: 26 Feb 2014 04:03
It looks like this may be the same as this:  http://kendoui-feedback.telerik.com/forums/127393-telerik-kendo-ui-feedback/suggestions/5567768-ability-to-start-the-listview-at-any-point-in-a-li