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

TreeList binding to remote data only supports "jsonp"?

1 Answer 114 Views
TreeList
This is a migrated thread and some comments may be shown as answers.
Frank
Top achievements
Rank 1
Frank asked on 27 Jul 2020, 01:36 PM

The example in the TreeList binding to remote data uses "jsonp". I tried "json" and it didn't work.

https://demos.telerik.com/kendo-ui/treelist/remote-data-binding

I have 2 questions:

1) does TreeList binding to remote data only support "jsonp"

2) in the example, when clicking on the tree list node, it includes "id=1" in the query string. Is the name "id" hardcoded? Is it configurable to have "studentId=1" in the query string?

Thanks

Frank

1 Answer, 1 is accepted

Sort by
0
Alex Hajigeorgieva
Telerik team
answered on 29 Jul 2020, 12:42 PM

Hello, Frank,

The Kendo UI TreeList data source inherits from the kendo DataSource which uses the jQuery ajax dataTypes as listed in the documentation, including "json":

https://docs.telerik.com/kendo-ui/api/javascript/data/datasource/configuration/transport.read#transportreaddatatype

In fact, "json" is the default dataType. I tested it with a mock server response and you can see that it works correctly:

https://dojo.telerik.com/@bubblemaster/EmUBoniH

If you need help with the binding, you can share your test response with me and I can assist you further.

For the second question, indeed, the default parameter is "id" and you can change it to whatever suits your service if you wish to lazy load the children by using the parameterMap function:

https://docs.telerik.com/kendo-ui/controls/data-management/treelist/binding#binding-to-remote-data

Kind Regards,
Alex Hajigeorgieva
Progress Telerik

Tags
TreeList
Asked by
Frank
Top achievements
Rank 1
Answers by
Alex Hajigeorgieva
Telerik team
Share this question
or