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 store/retrieve DahsboardLayout persistence values into/from database

Thread ID:

Created:

Updated:

Platform:

Replies:

148590 Oct 25,2019 04:03 PM UTC Oct 29,2019 11:56 AM UTC React - EJ 2 2
loading
Tags: DashboardLayout
Nikunj Panchal
Asked On October 25, 2019 04:03 PM UTC

Hello,

I enabled persistence setting (enablePersistence=true) for my Dashboard Layout component. With this, I received panels information in localStorage.

I have following questions:
  1. Initially when my Home screen loads, default portlets are shown on the screen. Then I removed portlet using removePanel method which updates my localStorage automatically. I have a Reset button which remove the localStroage and update the item with defaultportlets using the below code but it is not working. How can we do with the Syncfusion React component?
    window.localStorage.removeItem('DashboardLayoutsc_dashboard');
    window.localStorage.setItem('DashboardLayoutsc_dashboard'JSON.stringify(this.defaultPortlets));
    window.location.reload();
          
  1. We are converting our project from ExtJS to React using Syncfusion component. ExtJS provides state provider (https://docs.sencha.com/extjs/6.0.2/classic/Ext.state.Provider.html) which could be use  to store state on server side/ localStorage.  Is syncfusion has similar like this where we can store information on Database Instead of LocalStorage. Do you have any example for this? 

Shameer Ali Baig Sulaiman Ali Baig [Syncfusion]
Replied On October 28, 2019 12:12 PM UTC

Hi Nikunj,

 

Thanks for contacting Syncfusion support.

 

Solution for Query 1:

 

We have looked into your query on maintaining the state of the panels in the Dashboard Layout component. To achieve your requirement, instead of using window.localStorage, you can use the serialize() method (This method returns the component’s current panel setting which can be used to construct a dashboard with the same layout settings) of the Dashboard Layout component to keep the model object of the current panels state of the Dashboard Layout. Then, on resetting the component you can recreate with same panels state using that model object.  However, the panel header information, panel content information cannot be maintained. So, to update the panels with same content, you can use the updatePanel() method.

 

Please, check out the below sample which demonstrates the above mention details.

 

State-Maintenance: https://ej2.syncfusion.com/react/documentation/dashboard-layout/state-maintenance/?no-cache=1#panel-state-maintenance


Please, let us know if you need any further assistance.

 

Solution for Query 2:

 

We are currently analyzing about your expected requirement. We will update you with further details about this query in one business day on 29 October 2019.

 

Regards,

Shameer Ali Baig S.

 

 

 


Keerthana Rajendran [Syncfusion]
Replied On October 29, 2019 11:56 AM UTC

  
Hi Nikunj, 
 
Thanks for the patience. 
 
Query :  Is syncfusion has similar like this where we can store information on Database Instead of LocalStorage. Do you have any example for this?  
 
No, we have utilized only local storage for maintaining the state of the components only on page refresh and we don’t have a state provider similar to extjs. Please let us know if any concern 
 
Regards, 
Keerthana.  


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