5 Answers, 1 is accepted
0
Hello Ingo,
Alex Gyoshev
the Telerik team
If you want to access the data that has been passed when the treeview was initialized, you can use the get it from the options.dataSource field:
var data = $("#tree").data("kendoTreeView").options.dataSource;
Alex Gyoshev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Ingo
Top achievements
Rank 1
answered on 07 Mar 2012, 12:15 PM
Hi Alex,
thanks for your answer! I get the data if I am using this:
But what if I am using an unordered list (<ul><li>item</li></ul>) - can i get a serialized array / json array from the dataSource?
Thank you for your help!
Ingo
thanks for your answer! I get the data if I am using this:
$("#treeView").kendoTreeView({
dataSource: [
{
text: "Item 1",
items: [
{ text: "Item 1.1" },
{ text: "Item 1.2" }
]
},
{ text: "Item 2" }
]
})
But what if I am using an unordered list (<ul><li>item</li></ul>) - can i get a serialized array / json array from the dataSource?
Thank you for your help!
Ingo
0
Hello Ingo,
Alex Gyoshev
the Telerik team
Right now, the initial data is not kept in a dataSource, so there is no array that you can get from the treeview fields. You can, however, iterate through all treeview nodes with jQuery and create the dataSource manually.
All the best,Alex Gyoshev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Martin
Top achievements
Rank 1
answered on 04 May 2012, 03:09 PM
Hi guys,
Can anyone give a quick example on how to iterate through the treeview to get at complete liste of items either as array, JSON or ul/li?
I need it to save the updated treestructure to a database.
Kind regards
Martin
Can anyone give a quick example on how to iterate through the treeview to get at complete liste of items either as array, JSON or ul/li?
I need it to save the updated treestructure to a database.
Kind regards
Martin
0
Hello Martin,
Alex Gyoshev
the Telerik team
I replied to your question in the other forum thread.
Regards,Alex Gyoshev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!