enablePersistence to store only the layout without data

I tried to enable persistence on pivot view but once data is bigger, Safari returns error "quota has been exceeded". This is because the browser tries to save not only the layout definition but also data into local storage. How can I store only the layout definition to make it persistent in every case?  

2 Replies 1 reply marked as answer

DZ David Zencak August 12, 2020 11:09 AM UTC

I have found the solution:

1. update dataSourceSettings
fieldListRefreshed(args: FieldListRefreshedEventArgs): void {
this.dataSourceSettings = args.dataSourceSettings;
}

2. reset dataSource and save in ngOnDestroy
ngOnDestroy() {
this.dataSourceSettings.dataSource = [];
localStorage.setItem('pivotLayout', JSON.stringify(this.dataSourceSettings));
}

3. load settings from localstorage

Marked as answer

SN Sivamathi Natarajan Syncfusion Team August 13, 2020 05:19 AM UTC

 
Yes, this is the correct solution. And please let us know if you need any further assistance on this.  
 
Regards, 
Sivamathi. 


Loader.
Up arrow icon