At the moment I have a pull to refresh view based on the 'twitter' example you have, which works fine (see extract below)
At present, it is looking at json.txt included locally in my project and pulling data back via pull to refresh.
Now when I go to create a local data source:
var movies = [ {
title: "Star Wars: A New Hope",
year: 1977
}, {
title: "Star Wars: The Empire Strikes Back",
year: 1980
}, {
title: "Star Wars: Return of the Jedi",
year: 1983
}
];
var localDataSource = new kendo.data.DataSource({data: movies});
And adjust my pull to refresh view to look at this data source instead, I map the fields via the template and I get a list of results fine,
however I am unable to refresh it when I pull down, it just hangs! Are you able to provide me with a step in the right direction?
Thanks so much
Rgds.
____________________________________
The Kendo Template:
<script type="script/x-kendo-template" id="pull-to-refresh-template">
<div class="inboxList">
<h3 class="time">9:00am</h3><h3>The Purchace ID is:#: PurchaseID #</h3>
<a class="reply" data-role="button" data-rel="actionsheet" href="\\#inboxActions" data-actionsheet-context="ID">Reply</a>
<h2>Another Field</h2>
<p>Something here</p>
</div>
</script>
Json Txt Example:
{
"results": [
{
"UserID": "33",
"PurchaseID": 944000
},
{
"UserID": 2,
"PurchaseID": 3584
},
{
"UserID": 3,
"PurchaseID": 7473
},
{
"UserID": 4,
"PurchaseID": 8654
______
Javascript Functions:
function mobileListViewPullToRefresh() {
var dataSource = new kendo.data.DataSource({
serverPaging: true,
pageSize: 10,
transport: {
read: {
url: "json.txt",
dataType: "json" // JSONP (JSON with padding) is required for cross-domain AJAX
},
},
schema: { // describe the result format
data: "results" // the data which the data source will be bound to is in the "results" field
}
});
$("#pull-to-refresh-listview").kendoMobileListView({
dataSource: dataSource,
pullToRefresh: true,
appendOnRefresh: false,
template: $("#pull-to-refresh-template").text(),
endlessScroll: false,
pullParameters: function(item) {
return {
since_id: item.id_str,
page: 1
};
}
});
}