I am implementing an Endless Scrolling list view. I would like to persist the list data items and position when I navigate to a detail view and return. This works. I would also like to be able to completely reset the Endless Scrolling list view when I go back to the main app view and return to the Endless Scrolling ListView, just like I had set the Endless Scrolling view itself to data-reload="true". This is not working for me.
I can reset and clear a normal ListView like this;
contactListSource = new kendo.data.DataSource.create({data:[]});
$("#contacts_list_search_results").kendoMobileListView({
dataSource: contactListSource,
template: $("#contact_list_item_template").html()
});
The paging functionality complicates the clear with the Endless Scrolling list and causes issues when I try to reset the ListView. The next time I come back to the Endless Scrool List the display starts in the middle of the list, and the first records from the list often don't get displayed. This is what I have so far to clear and rest (it only works if I have not scrolled on the original list, so I believe the issue has to do with a persisted scroll position):
$(".km-scroll-container").css("-webkit-transform", "");
$("#contacts_list_search_results").data("kendoMobileListView").dataSource.data([]);
$("#contacts_list_search_results").data("kendoMobileListView").dataSource._page=1;
$("#contacts_list_search_results").data("kendoMobileListView").dataSource._skip=0;
How is it possible to completely clear and reset and Endless Scrolling list view?
Thanks,
Derrick
I can reset and clear a normal ListView like this;
contactListSource = new kendo.data.DataSource.create({data:[]});
$("#contacts_list_search_results").kendoMobileListView({
dataSource: contactListSource,
template: $("#contact_list_item_template").html()
});
The paging functionality complicates the clear with the Endless Scrolling list and causes issues when I try to reset the ListView. The next time I come back to the Endless Scrool List the display starts in the middle of the list, and the first records from the list often don't get displayed. This is what I have so far to clear and rest (it only works if I have not scrolled on the original list, so I believe the issue has to do with a persisted scroll position):
$(".km-scroll-container").css("-webkit-transform", "");
$("#contacts_list_search_results").data("kendoMobileListView").dataSource.data([]);
$("#contacts_list_search_results").data("kendoMobileListView").dataSource._page=1;
$("#contacts_list_search_results").data("kendoMobileListView").dataSource._skip=0;
How is it possible to completely clear and reset and Endless Scrolling list view?
Thanks,
Derrick