ListView auto paging aka incremental loading aka infinite scroll

Oct 31, 2014 at 7:12 PM
Hi there,

I absolutely need to implement the old incremental loading behavior for listviews, which has been deprecated, for an Universal App that runs on both Windows Phone 8.1 and Windows 8.1.

I'm using bleeding edge WinJS 3.0.1.

I tried the code in the samples at https://codeshow.codeplex.com/SourceControl/latest#codeShow.JS/codeShow.JS.Shared/demos/livelistview/livelistview.js and in the new ListView example at https://code.msdn.microsoft.com/windowsapps/ListView-loading-behaviors-718a4673
They all work fine because there is a fake (synchronous) data source with a WinJS.Binding.List, that pushes some objects into a simple array.

I tried merging that with a custom data source, inspired by the custom dataSource example of https://code.msdn.microsoft.com/windowsapps/ListView-custom-data-4dcfb128/

Well, what happens is that all requests are fired at the same time, and there seem no way of getting the wished incremental loading behavior working (one page at time, loading next page when I'm done scrolling).
Is there any chance to get help about this, or even better integrating an ansynchronous data source into the samples of codeshow, so that it better emulates a real scenario?
Wouldn't it be nice if ListView exposed a 'scrollend' event to easily handle this kind of situations? I also tried the 'scroll' event listener approach, but I've got no luck with touch screens :(

Thank you in advance,

Vito Macchia
Nov 4, 2014 at 1:27 PM
After struggling a bit, I found a solution which I posted here: https://github.com/winjs/winjs/issues/690#issuecomment-61637832

I think a more elegant way of doing this should be allowed by WinJS itself, though!