Hi Visha,
Thanks for contacting Syncfusion support.
Query: Is there any way we can save grid filters in browser's memory or may be in the database for individual users?
Based on your query we suspect that you want to save the Grid’s filtered state in your Grid application. By default in EJ2 Grid you can maintain the state of the Grid by enabling the enablePersistence property.
To achieve your requirement we suggest you use the getPersistData method of EJ2 Grid to get the persisted grid state and using the setProperties method of EJ2 Grid you can restore the Grid state. The persistence feature will store the Grid settings in the browser’s local storage. For your convenience we have attached the sample and documentation, please refer them for your reference.
Code Example:
App.component.ts
onSave() {
this.savedProperties = JSON.parse(this.grid.getPersistData()); // get the current grid state here.
console.log( this.savedProperties )
}
onRestore() {
var persist= this.savedProperties
this.grid.setProperties(persist); // set the properties to restore the state.
console.log(persist)
} |
Note: Using the getPeristData method you can get the persistData and store them in your database.
Please get back to us if you need further assistance.
Regards,
Ajith G.