7 Answers, 1 is accepted
Hi Majeed,
Here is a StackBlitz example demonstrating how we can get the data of the TreeeView's datasource and stringify it. In the linked example, there is the below code that stringifies the data available in the datasource.
mounted: function() {
let treeView = this.$refs.treeview.kendoWidget();
console.log(JSON.stringify(treeView.dataSource.data()));
}
The above approach can be used not only in the mounted hook but anywhere in your application.
I hope the provided example will help you resolve the issue in your application.
Regards,
Petar
Progress Telerik
Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Hi Majeed,
Which Kendo UI for Vue version do you use? Does your last reply means that you've managed to resolve the issue?
Regards,
Petar
Progress Telerik
Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Hi Majeed,
Attached to my reply, you will find a runnable example demonstrating the usage of the below code with the latest version of the TreeView component.
JSON.stringify(treeView.dataSource.data()
Check the provided project and let me know if you can replicate the reported behavior in it.
Regards,
Petar
Progress Telerik
Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Hi petar, I have seen your example but I see that problem when structure of data in treeview datasource is following :
var
data = [ {
_id:
"5faab538834bf81300d6ba3d"
,
aggregates: [],
decimal: 0,
field:
"t_5ebc1390cdcffd48e4b4ddbc_fruit"
,
filterType:
"checkbox"
,
hasChildren:
false
,
hidden:
false
,
index: 0,
items: [],
orderpatharray: [ { a : 1 , b : 2} ],
parentid:
null
,
path:
""
}];
when you have a simple structure or change your kendo version to "2020.3.915" ,error do not occur; I suppose this problem is related to data's structure and when one array exists in your data.
Regard
Majeed
Hi Majeed,
Attached to my reply, you will find an edited version of the project I've sent you in my previous reply. This time the TreeView works with the data that you've shared. I only edited the IDs and the field name in order to have different fields inside the component.
Using the data you've shared, I again cannot replicate any issues when using JSON.stringify.
Check the attached project and let me know if you can replicate the issue that you have on your end.
Regards,
Petar
Progress Telerik
Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.