07-12-2013 09:20 AM
Currently I'm using atEnd within ListScrollStateHandler:nScrollingChanged, to know when to read more data into my ListView, this works but doesn't feel right as there is a brief pause while I load data. What I am looking for is something that will allow me to trigger LoadMoreData() when I'm at atEnd-5 or atEnd-10 records before the listview end...
Also, I'm not sure how to obtain the current scroll/record postion within the listview and the total scroll /record count.
If someone could suggest a approach it would be appreciated..
07-12-2013 11:41 AM
Check out session JAM 358 from last Jam in Europe: it handled infinite lists quite well. Link
07-12-2013 07:33 PM
07-22-2013 02:33 PM - edited 07-23-2013 01:22 PM
If your item visuals are created from a ListItemComponent, then you can achieve this using the the ListItem.indexInSection and ListItem.sectionSize properties that the ListView makes availabe on the root element of the item visual
if(ListItem.indexInSection + 5 == ListItem.sectionSize) // or 10 if looking for the 10th item from the bottom
// load more data
For mor information on those properties checkout this link.
07-22-2013 03:36 PM
I think this is exactly what I'm looking for, let me try it out and I'll let you know..