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

TypeError: cyclic object value

7 Answers 287 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Majeed
Top achievements
Rank 2
Majeed asked on 10 Nov 2020, 02:03 PM

I see this error when I'm going to convert data of treeview's datasource to stringify.

I use kendo vue js like :

JSON.stringify( ....data("kendoTreeview").dataSource.data() )

7 Answers, 1 is accepted

Sort by
0
Petar
Telerik team
answered on 12 Nov 2020, 09:12 AM

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/.

0
Majeed
Top achievements
Rank 2
answered on 12 Nov 2020, 09:41 AM
I use this structure after mounting, but I see that error, when I changing version of kendo vue, this error solved
0
Petar
Telerik team
answered on 12 Nov 2020, 12:29 PM

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/.

0
Majeed
Top achievements
Rank 2
answered on 12 Nov 2020, 01:58 PM
When I use kendo vue  "@progress/kendo-ui" version "2020.3.1021" I see that problem and after that this problem have been managed when I use version "2020.3.915".
0
Accepted
Petar
Telerik team
answered on 16 Nov 2020, 10:21 AM

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/.

0
Majeed
Top achievements
Rank 2
answered on 30 Nov 2020, 09:43 AM

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

0
Petar
Telerik team
answered on 02 Dec 2020, 07:22 AM

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/.

Tags
General Discussions
Asked by
Majeed
Top achievements
Rank 2
Answers by
Petar
Telerik team
Majeed
Top achievements
Rank 2
Share this question
or