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. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to Save Layout of changed field for Pivot Table on run time

Thread ID:

Created:

Updated:

Platform:

Replies:

143952 Apr 11,2019 12:05 PM UTC Apr 12,2019 09:51 AM UTC ASP.NET MVC - EJ 2 1
loading
Tags: PivotGrid
Jasem ALheket
Asked On April 11, 2019 12:05 PM UTC

Hi 
i am using Pivot Table control of JS2 for MVC 5 , 

i already enabled the the field list option ,it is a great option , but i have once concern if the there is an option to save the end-user modification of the layout to use it later ,
i found this article https://help.syncfusion.com/aspnet/pivotgrid/save-load but it is about ASP.NET form and version JS 1 

could anyone help me 

Thankx

Deivaselvan Y [Syncfusion]
Replied On April 12, 2019 09:51 AM UTC

Hi Jasem, 
 
Thanks 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 Snippet: 
document.getElementById("save-btn").addEventListener('click', function () { 
        var pivotGridObj = document.getElementById('PivotGrid').ej2_instances[0]; 
        var dataSource = JSON.parse(pivotGridObj.getPersistData()).dataSource; 
        localStorage.pivotReport = JSON.stringify(dataSource); 
}); 
document.getElementById("load-btn").addEventListener('click', function () { 
        var pivotGridObj = document.getElementById('PivotGrid').ej2_instances[0]; 
        var dataSource = JSON.parse(localStorage.pivotReport); 
        pivotGridObj.dataSource = dataSource; 
});  
 
 
Please let us know if you have any other queries. 
 
Regards,
Deivaselvan
 


CONFIRMATION

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