Just when I think I have it beat another problem comes up with Listview Endless Scrolling.
Attached are a couple screenshots from my app on an iPad mini. Quick background on the app:
This view of the app - General Log - should display a list of all log entries entered into the system from the beginning of time (app time that is). This particular log contains 4252 entries as stored in the "total" field of the datasource. pageSize = 100 and I have verified that with each pull there are exactly 100 records returned from the server. Everything works flawlessly in the Icenium emulator and about 90% of the time when executed as a Cordova app on an iPhone4s and iPhone5. On larger tablet devices the listview breaks 100% of the time when the endless scroll mechanism tries to fetch a new batch of records AND the user is scrolling quickly. If you scroll very slowly through all records the endless scroll does its job and all is well - but, try scrolling fast - like all users do - and it breaks.
I know that per the documentation notes you need a minimum number of records in the pageSize so that the virtual listview can regenerate as required. I have tried a range of pageSizes and for the phone devices 100 works well. On the tablets it doesn't matter what the pageSize is - same results.
Overall scrolling performance with Endless scrolling enabled is also very poor. With 100 records loaded the scrolling is choppy at best. Disabling endless scrolling and those same 100 records scroll like butter.
Screenshots:
1) Blank area at top of listview. This seems to happen when the virtual listview can't keep up with the scrolling and once this happens the only way to recover is to close the view and reopen it. No new pages will be pulled from the server and scrolling breaks almost completely. My assumption is that the threshold/trigger that causes the datasource to update is too high and by the time the data is pulled from the server the scrolling has already passed the virtual limit and it can't recover. Can the threshold be modified to update the datasource when the scroller hits 50% of the data instead of the default 66% or whatever it is?
2) Continuing to scroll down from the "blank" top of #1 you reach the bottom of the active scroller and it will not continue fetching pages and you can see the rendering of list items becomes unstable - note the overlapping list items.
Here is my code - there may be a glaring error but I can't see it. Again, everything works like expected in the emulator and almost always on smaller devices - problem is severe on tablets - both iOS and Android. I'll try any suggestions and report back - I find it hard to believe I'm the only one experiencing this type of problem.
// GENERAL LOG
var genLogDataSource = new kendo.data.DataSource({
pageSize: 100,
serverPaging: true,
transport: {
read: {
url: "https://xxxxxxxx.xxx/xx/xxx/generalLog.php",
type: "GET",
dataType: "json"
},
parameterMap: function(options) {
return {
take: options.take,
skip: options.skip
};
}
},
schema: {
data: "ds",
total: "total"
}
});
function initGenLog(){
$("#listview-genlog").kendoMobileListView({
dataSource: genLogDataSource,
template: $("#listview-genlog-template").html(),
endlessScroll : true,
click: function(e){
var fileId = e.target.attr('fileId');
if(fileId) openFile(fileId);
else return false;
}
});
}
Attached are a couple screenshots from my app on an iPad mini. Quick background on the app:
This view of the app - General Log - should display a list of all log entries entered into the system from the beginning of time (app time that is). This particular log contains 4252 entries as stored in the "total" field of the datasource. pageSize = 100 and I have verified that with each pull there are exactly 100 records returned from the server. Everything works flawlessly in the Icenium emulator and about 90% of the time when executed as a Cordova app on an iPhone4s and iPhone5. On larger tablet devices the listview breaks 100% of the time when the endless scroll mechanism tries to fetch a new batch of records AND the user is scrolling quickly. If you scroll very slowly through all records the endless scroll does its job and all is well - but, try scrolling fast - like all users do - and it breaks.
I know that per the documentation notes you need a minimum number of records in the pageSize so that the virtual listview can regenerate as required. I have tried a range of pageSizes and for the phone devices 100 works well. On the tablets it doesn't matter what the pageSize is - same results.
Overall scrolling performance with Endless scrolling enabled is also very poor. With 100 records loaded the scrolling is choppy at best. Disabling endless scrolling and those same 100 records scroll like butter.
Screenshots:
1) Blank area at top of listview. This seems to happen when the virtual listview can't keep up with the scrolling and once this happens the only way to recover is to close the view and reopen it. No new pages will be pulled from the server and scrolling breaks almost completely. My assumption is that the threshold/trigger that causes the datasource to update is too high and by the time the data is pulled from the server the scrolling has already passed the virtual limit and it can't recover. Can the threshold be modified to update the datasource when the scroller hits 50% of the data instead of the default 66% or whatever it is?
2) Continuing to scroll down from the "blank" top of #1 you reach the bottom of the active scroller and it will not continue fetching pages and you can see the rendering of list items becomes unstable - note the overlapping list items.
Here is my code - there may be a glaring error but I can't see it. Again, everything works like expected in the emulator and almost always on smaller devices - problem is severe on tablets - both iOS and Android. I'll try any suggestions and report back - I find it hard to believe I'm the only one experiencing this type of problem.
// GENERAL LOG
var genLogDataSource = new kendo.data.DataSource({
pageSize: 100,
serverPaging: true,
transport: {
read: {
url: "https://xxxxxxxx.xxx/xx/xxx/generalLog.php",
type: "GET",
dataType: "json"
},
parameterMap: function(options) {
return {
take: options.take,
skip: options.skip
};
}
},
schema: {
data: "ds",
total: "total"
}
});
function initGenLog(){
$("#listview-genlog").kendoMobileListView({
dataSource: genLogDataSource,
template: $("#listview-genlog-template").html(),
endlessScroll : true,
click: function(e){
var fileId = e.target.attr('fileId');
if(fileId) openFile(fileId);
else return false;
}
});
}