I have a listView that has endlessScroll enabled:
It is bound to a dataSource that gets its data from a remote source that has tens of thousands of records:
This works fine when I start the listView from the *first* page because all the other pages come after it, so only endlessScrolling in the downward direction is necessary. However, sometimes I need to start the listView on a specific page other than page 1:
Again, the data is displayed as expected in the listView and endlessScrolling in the downward direction works. However, when I try to scroll up to see the records on the previous page (i.e. page 44), nothing happens. Apparently, endlessScrolling only works in one direction (down), even though it seems it would be trivial for it to make a call to the dataSource to retrieve the previous page (up) just as it retrieves the next page (down).
In a nutshell, I need to be able to take a listView which is remotely bound to thousands of records and start from any page and endlessScroll in either direction. This seems like it would be a pretty fundamental feature. Is there a way to do this?
Thanks in advance.
$(
'#MyListView'
).kendoMobileListView({
dataSource: myRemoteDataSource,
template: myTemplate,
autoBind:
false
,
endlessScroll:
true
,
scrollTreshold: 30
});
It is bound to a dataSource that gets its data from a remote source that has tens of thousands of records:
var
myRemoteDataSource =
new
kendo.data.DataSource({
pageSize: 10,
serverPaging:
true
,
transport: {
read: {
url:
'http://myremotedata'
},
parameterMap:
function
(data, type) {
var
startRow = ((data.page - 1) * data.pageSize) + 1;
return
{
strow: startRow,
rpp: data.pageSize
};
}
},
schema: {
data:
'Data'
,
total:
'Total'
}
});
This works fine when I start the listView from the *first* page because all the other pages come after it, so only endlessScrolling in the downward direction is necessary. However, sometimes I need to start the listView on a specific page other than page 1:
myRemoteDataSource.query({ page: 45, pageSize: 10 });
// 45 is a random page.
Again, the data is displayed as expected in the listView and endlessScrolling in the downward direction works. However, when I try to scroll up to see the records on the previous page (i.e. page 44), nothing happens. Apparently, endlessScrolling only works in one direction (down), even though it seems it would be trivial for it to make a call to the dataSource to retrieve the previous page (up) just as it retrieves the next page (down).
In a nutshell, I need to be able to take a listView which is remotely bound to thousands of records and start from any page and endlessScroll in either direction. This seems like it would be a pretty fundamental feature. Is there a way to do this?
Thanks in advance.