Declined
Last Updated: 30 Mar 2021 14:25 by ADMIN
Hector
Created on: 24 Mar 2021 06:56
Category: DropDownTree
Type: Bug Report
0
Nodes with elements from remote data not working

Hi
I have a problem with the DropDownTree component.
From a remote data source type json I am getting a tree with two levels of data but it only shows the first level.

Code:

$("#dropdowntree").kendoDropDownTree({
	dataSource: {
		transport: {
			read: {
				url: "/api/getData",
				type: "POST",
				dataType: "json",
				contentType: "application/json; charset=utf-8"
			}
		}
	},
	checkboxes: true
});

Response:

[
	{
		text: "Furniture", expanded: true, items: [
			{ text: "Tables & Chairs" },
			{ text: "Sofas" },
			{ text: "Occasional Furniture" }
		]
	},
	{
		text: "Decor", items: [
			{ text: "Bed Linen" },
			{ text: "Curtains & Blinds" },
			{ text: "Carpets" }
		]
	}
]
But if I set the data from a js object it shows the two levels correctly
$("#dropdowntree").kendoDropDownTree({
	dataSource: {
		data: [
			{
				text: "Furniture", expanded: true, items: [
					{ text: "Tables & Chairs" },
					{ text: "Sofas" },
					{ text: "Occasional Furniture" }
				]
			},
			{
				text: "Decor", items: [
					{ text: "Bed Linen" },
					{ text: "Curtains & Blinds" },
					{ text: "Carpets" }
				]
			}
		]
	},
	checkboxes: true
});
Previously it worked, I don't know which version of kendo stopped working.
How can I solve it with a single request to the server?
1 comment
ADMIN
Martin
Posted on: 30 Mar 2021 14:25

Hello, Hector,

I have already addressed the issue in the support ticket #1512634 you opened on the same topic. I will share my reply here as well if anyone is having the same problem.

The issue is due to the lack of dataSource.schema as demonstrated in our Remote Binding demo

If that is not what is causing the problem, please edit the above demo so that I can observe the issue and investigate further.

Regards,
Martin
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.