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. Image for the cookie policy date

Is it possible to persist filter, sorting and grouping selections on grid

Hi Support:

We have a grid with the Excel like filtering enabled. Would be possible to persists the filter, sorting, paging and  grouping selection during whole user session.  

The idea is that the user will filter the Model column (for example show only  the Toyota Corolla) and then when he navigates to to another page and then comeback to the grid, the filter criteria is still selected with the Corolla value. 


Thanks in advanced

David

5 Replies

SA Saravanan Arunachalam Syncfusion Team August 28, 2017 05:29 AM UTC

Hi David, 
Thanks for contacting Syncfusion’s support. 
Yes, we can persist the user session by define enable-persistence property of Grid control as true and we have already discussed this query in the following documentation link. 
Regards, 
Saravanan A. 



DS dsapo August 28, 2017 04:35 PM UTC

Thanks Saravanan  for your help.



SA Saravanan Arunachalam Syncfusion Team August 29, 2017 04:57 AM UTC

Hi David,  
Thanks for your update.            
We are happy that the provided information helped you. 
Regards, 
Saravanan A. 



KL Klaus October 14, 2017 09:33 PM UTC

Hi,

i'm working on an grid with server side paging and enablePersitence. (I'm binding the Datasource with ".Datasource(ds.URL("/controller/datasource").Adaptor("UrlAdaptor")))

Everything works as expected, except the current page number is not stored/restored. 

What i'm trying to do: 

1) I have a grid which contains a list of items. 

2) when the user clicks on an item, the user will be directed to a details view of the item, where the user may modify the item etc.

3) when the user navigates back without providing the pagenumber, the filter/sorting is correctly restored, but not the current page. 

Question: Is it possible to restore the "current" page without providing the page=123 parameter in the redirect url?


(MVC 5 with Grid)

thanks in advance,

Klaus





SA Saravanan Arunachalam Syncfusion Team October 16, 2017 09:54 AM UTC

Hi Klaus, 
We are sorry that we are unable to reproduce your reported issue and we have created a sample that can be downloaded from the below link. 
In the above sample, we have performed on demand paging using urladaptor and it is persisted by defining the enable-persistence as true. Please refer to the below code example. 
<ej-grid id="MasterGrid" allow-paging="true" enable-persistence="true" allow-filtering="true" allow-sorting="true"> 
    <e-datamanager adaptor="UrlAdaptor" url="Home/DataSource"></e-datamanager> 
    . . . 
</ej-grid> 
 
[Controller] 
public ActionResult DataSource([FromBody]Syncfusion.JavaScript.DataManager dm) 
        { 
            IEnumerable Data = GetAllRecords(); 
            Syncfusion.JavaScript.DataSources.DataOperations operation = new Syncfusion.JavaScript.DataSources.DataOperations(); 
            if (dm.Sorted != null && dm.Sorted.Count > 0) //Sorting 
            { 
                Data = operation.PerformSorting(Data, dm.Sorted); 
            } 
            if (dm.Where != null && dm.Where.Count > 0) //Filtering 
            { 
                Data = operation.PerformWhereFilter(Data, dm.Where, dm.Where[0].Operator); 
            } 
            int count = Data.AsQueryable().Count(); 
            if (dm.Skip != 0) 
            { 
                Data = operation.PerformSkip(Data, dm.Skip); 
            } 
            if (dm.Take != 0) 
            { 
                Data = operation.PerformTake(Data, dm.Take); 
            } 
            return Json(new { result = Data, count = count }); 
        } 
 
 
If the issue is still exist, please provide the following details. 
1.       Replication procedure to reproduce your reported issue. 
2.       Share video clip to replicas the issue. 
3.       If possible, please reproduce the issue in above attached sample. 
Regards, 
Saravanan A. 


Loader.
Up arrow icon