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

Kendoui Datasource & Json Issue

1 Answer 117 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
tundecanhelp
Top achievements
Rank 2
tundecanhelp asked on 26 Aug 2013, 12:31 PM
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.

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.});

1 Answer, 1 is accepted

Sort by
0
Steve
Telerik team
answered on 27 Aug 2013, 03:41 PM
Hi,

Representation of hierarchical data in Kendo UI can be accomplished via the HierarchicalDataSource component which extends the DataSource component. Be aware that at this time, the only widget that is aware of the datasource hierarchy is the TreeView. However, since the HierarchicalDataSource inherits the DataSource component, you can share the root level of the hierarchy with any DataSource-enabled component.

Regards,
Steve
Telerik

Looking for tips & tricks directly from the Icenium team? Check out our blog!
Share feedback and vote for features on our Feedback Portal.
Tags
General Discussions
Asked by
tundecanhelp
Top achievements
Rank 2
Answers by
Steve
Telerik team
Share this question
or