Only save layout of pivot view

Hello,
we save and load the layout of the pivot view by using your provided methods this.pivotObj.getPersistData() and this.pivotObj.loadPersistData(this.pivotLayout).
Unfortunately it saves the whole content of the pivot grid, not only the layout. This is not very useful when having big amounts of data in the table. Is there a possibility to only save and load the layout of the pivot view?

Best regards
Gerd Tautenhahn

3 Replies

SN Sivamathi Natarajan Syncfusion Team May 18, 2020 02:53 PM UTC

Hi Gerd Tautenhahn, 
  
You can save and load the layout alone without data source using following code example.  
  
Code Example: 
 saveButton(e: Event): void { 
    // You can remove the data source here while saving 
    var dataSource = JSON.parse(this.pivotObj.getPersistData()).dataSourceSettings; 
    dataSource.dataSource = []; 
    localStorage.pivotReport = JSON.stringify(dataSource); 
  } 
  
  loadButton(e: Event): void { 
    // You can load the cotrol without data source. 
    var dataSource = JSON.parse(localStorage.pivotReport); 
    this.pivotObj.dataSourceSettings = dataSource; 
  } 
  
  
Meanwhile, we have prepared a sample for your reference. Please check the below sample link. 
  
  
Please let us know if you have concern. 
  
Regards, 
Sivamathi. 



GT Gerd Tautenhahn May 19, 2020 12:03 PM UTC

This works. Thank you for you help.


SN Sivamathi Natarajan Syncfusion Team May 20, 2020 08:03 AM UTC

Hi Gerd Tautenhahn, 
  
Thanks for the response. 
  
Regards, 
Sivamathi. 


Loader.
Up arrow icon