This is a migrated thread and some comments may be shown as answers.

Kendo UI: Endless scroll load from URL

1 Answer 10 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Saurabh
Top achievements
Rank 1
Saurabh asked on 07 Feb 2014, 10:29 AM
So far I have managed to load data from url and show on list, but once my list ends,
I need to load data from next url .Here is my code:

var i = 0, pageSize = 10;<br>
function mobileListViewEndlessScrolling() {<br>
var dataSource = new kendo.data.DataSource({<br>
type: "odata",<br>
transport : {<br>
read: {<br>
type : "GET",<br>
url : "https://graph.facebook.com/siedae/feed?access_token=150129068491462|a8HxcqfRA-Bn1M59A_wefbEMs9c",<br>
contentType: "application/json; charset=utf-8",<br>
dataType : "json",<br>
error : function (xhr, ajaxOptions, thrownError) {<br>
alert("error " + xhr.responseText);<br>
},<br>
}<br>
},<br>
serverPaging: true,<br>
pageSize: pageSize,<br>
schema: {<br>
data : "data",<br>
total: function() { return 25; }<br>
},<br>
});<br>
$("#endless-scrolling").kendoMobileListView({<br>
dataSource: dataSource,<br>
template: $("#endless-scrolling-template").text(),<br>
endlessScroll: true,<br>
scrollTreshold: 30 ,<br>
}); <br>
}<br>

1 Answer, 1 is accepted

Sort by
0
Kiril Nikolov
Telerik team
answered on 10 Feb 2014, 08:33 AM
Hi Saurabh,

You need to set serverPaging option for the ListView to true, and then implement functionality that will change the URL based on the response from the facebook api. In general providing custom solutions falls outside of the scope of the standard support services, but please check the following example and let me know if it helps:

http://jsbin.com/goxe/1/edit


Regards,
Kiril Nikolov
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
General Discussions
Asked by
Saurabh
Top achievements
Rank 1
Answers by
Kiril Nikolov
Telerik team
Share this question
or