We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Save and load dataSource properties

Thread ID:





145580 Jun 28,2019 02:06 PM UTC Jul 1,2019 06:28 AM UTC JavaScript - EJ 2 1
Tags: PivotGrid
Alex Siler
Asked On June 28, 2019 02:06 PM UTC

Hello, I consult you about the dataSource property of the Pivot Gid. I am using the component in a form and I need to save the following dataSource properties: ['values', 'rows', 'columns', 'calculatedFieldSettings', 'filterSettings', 'sortSettings'].
When editing the form, the properties are set in the dataSource and everything works perfect; but when saving the changes I get an error 'Converting circular structure to JSON' because the properties were set as instances of t in the dataSource instead of appearing as an array.
Is there any solution?

Dinesh Babu Yadav [Syncfusion]
Replied On July 1, 2019 06:28 AM UTC

Hi Alex, 
Thank you for contacting Syncfusion support. 
You can get the report at any time by using getPersistData method and save it into the database. Please refer the below code snippet. 
Code Example :  
savebutton.element.onclick = function () { 
    //You can get the report and save into the database here. 
    var dataSource = JSON.parse(pivotGridObj.getPersistData()).dataSource; 
    localStorage.pivotReport = JSON.stringify(dataSource); 
      loadbutton.element.onclick = function () { 
      //You can fetch the report and load it here. 
      var dataSource = JSON.parse(localStorage.pivotReport); 
      pivotGridObj.dataSource = dataSource; 
Please let us know if you require further assistance. 
Dinesh Babu Yadav 


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon