Is it possble to pre-set filters on a grid when it's loading?

I've got a situation where a customer uses the filter bar, then selects an action on a particular row of the grid. When they're done with what they're doing, they hit the browser's "back" button, and the grid is unfiltered, making them re-do the filter every time they do something. Is it possible to save the filter settings before leaving the page, and then restore them when it comes back? I've already found PageSettings.CurrentPage, which will allow me to go back to the page they were on, but I didn't find anything similar for filters.

1 Reply

FS Farveen Sulthana Thameeztheen Basha Syncfusion Team February 16, 2018 03:53 AM UTC

Hi Brian, 

Thanks for contacting Syncfusion Support. 

We have checked your query and if you want to maintain the filter settings before leaving the page, and then restore them when it comes back , you can use “StatePersistence” property of the Grid. To enable persistence, you need to set  ‘enable-persistence’ property as true. The state persistence will maintain the Grid state in browser’s local storage even if browser refresh or move to next page. 

Please refer to the code example:- 

<ej-grid id="FlatGrid" allow-paging="true" enable-persistence="true" allow-filtering="true" >  
    <e-columns>  
        <e-column field="OrderID" header-text="Order ID" is-identity="true" is-primary-key="true" text-align="Right" width="75"></e-column>  
         <e-column field="EmployeeID" header-text="Employee ID" text-align="Right" width="75"></e-column>  
    </e-columns>  
</ej-grid>  


Please refer to the documentation Link:- 

Please get back to us if you need any further assistance. 

Regards, 
Farveen sulthana T 



Loader.
Up arrow icon