I am trying to use kendoui datasource to pull list of post into a listview with Hierarchical data binding from a Wordpress site using json. Please point me to the right direction in doing this, i have tried using kendoui datasource but no luck on this.
Below is the code i am working with so far.
Below is the code i am working with so far.
01.
var
dataSource =
new
kendo.data.DataSource({
02.
transport: {
03.
read: {
05.
contentType:
"application/json; charset=utf-8"
,
06.
dataType:
"jsonp"
,
// "jsonp" is required for cross-domain requests; use "json" for same-domain requests
07.
}
08.
},
09.
schema: {
10.
data:
function
(response) {
11.
return
response.posts;
// twitter's response is { "results": [ /* results */ ] }
12.
}}
13.
});
14.
dataSource.fetch(
function
(){
15.
var
data =
this
.data();
16.
console.log(data.length);
17.
console.log(data[0].title);
18.
dataSource.sync();
19.
});