How to retrieve the grid model so I can manually set it to local storage?

Hi Syncfusion,


I am referring to this documentation. How do I get the model from the grid? The documentation only shows setting the model to local storage but does not show how to actually get the model variable. Any help would be appreciated. Thank you so much! 




1 Reply

PS Pavithra Subramaniyam Syncfusion Team April 7, 2022 03:17 PM UTC

Hi Vince,


Thanks for contacting Syncfusion support.


You can get the current Grid model by using the “getPersistData” method which will return the Grid settings in a string format.


 

getState() {

  this.gridState = JSON.parse(this.grid.getPersistData()); // get the Grid state

}

 


API: https://ej2.syncfusion.com/documentation/api/grid/#getpersistdata


Please get back to us if you need further assistance on this.


Regards,

Pavithra S


Loader.
Up arrow icon