Hi,
I have a problem with endlessScroll in mobile ListView. The problem is, when last page is loaded, if I scroll down it continue to load last page over and over again.
Here are the code snippets that show how list is defined and initialized:
Additional notes: List shows items based on selection in previous view. Data source is created every time from beginning. Upon first selection, list is initialized. Other selections change data source and refresh list.
I get same behaviour if I use loadMore option instead of endlessScroll.
Could you please help? If this is expected behaviour, is there an option to disable endless scroll using JavaScript (for example, when last page is loaded)?
I have a problem with endlessScroll in mobile ListView. The problem is, when last page is loaded, if I scroll down it continue to load last page over and over again.
Here are the code snippets that show how list is defined and initialized:
<
div
id
=
"view-list"
data-role
=
"view"
data-layout
=
"view-layout"
>
<
div
>
<
ul
id
=
"list"
>
</
ul
>
</
div
>
</
div
>
var
dataSource =
new
kendo.data.DataSource({
pageSize: 10,
page: 1,
serverPaging:
true
,
transport: {
read: {
url: url,
dataType:
"jsonp"
},
parameterMap:
function
(options) {
var
parameters = {
pageSize: options.pageSize,
page: options.page
}
return
parameters;
}
},
schema: {
data:
function
(data) {
return
data.result;
},
total:
function
(data) {
return
data.count; // total number of items
}
},
error:
function
() {
onError(
"Communication error"
);
}
});
if
($(
"#list"
).data(
"kendoMobileListView"
) == undefined) {
$(
"#list"
).kendoMobileListView({
dataSource: dataSource,
template: $(
"#template"
).html(),
endlessScroll:
true
,
scrollTreshold: 30,
click:
function
(e) {
...
}
});
}
else
{
$(
"#list"
).data(
"kendoMobileListView"
).dataSource = dataSource;
$(
"#list"
).data(
"kendoMobileListView"
).refresh();
}
Additional notes: List shows items based on selection in previous view. Data source is created every time from beginning. Upon first selection, list is initialized. Other selections change data source and refresh list.
I get same behaviour if I use loadMore option instead of endlessScroll.
Could you please help? If this is expected behaviour, is there an option to disable endless scroll using JavaScript (for example, when last page is loaded)?