FilterBarTemplate not works with persistance

I use the filterBarTemplate

            .FilterBarTemplate(filterbar => filterbar.Write("dropdown_write").Read("dropdown_read"))

it works with     .EnablePersistence(false)  
but only the fist time with     .EnablePersistence(true)

video demo
https://youtu.be/PWF8cL-XbeA

version info
18.2.0.46 EJ1 not EJ2

p.s.
i can't understand i'm not able to put thread on ej1 ...


1 Reply 1 reply marked as answer

PK Padmavathy Kamalanathan Syncfusion Team August 10, 2020 11:58 AM UTC

Hi Alessandro, 
  
Thanks for contacting Syncfusion Forums. 
  
QUERY: Filterbar template not works with persistence 
  
We are able to reproduce the reported issue at our end.  This can be resolved by ignoring the "columns" property from persisting. "IgnoreOnPersist" method contains list of properties that are being ignored from persisting. We can add "columns" property to this list in document ready function and resolve this filter bar template issue with persistence. 
  
Please check the below code snippet, 


 
  
@(Html.EJ().Grid<object>("Grid" 
                        .Datasource(datasource => datasource.URL(urlGet)  
                  //più metodi per tirare su i dati  
                  .Adaptor(AdaptorType.UrlAdaptor))  
                  .AllowPaging().AllowFiltering().AllowResizing()  
                   .EnablePersistence()  
         )  
  
    <script type="text/javascript">  
        $(function () {  
            setTimeout(function () {  
                var obj = $("#Grid").ejGrid("instance");  
                 // use the grid id to take the grid instance  
  
               obj.ignoreOnPersist("columns");  
                // ignore the columns property from persist 
  
            })  
  
        })  
</script>  

 
NOTE: We have limitation in using the above solution. Since we are ignoring the columns from persisting, the column resizing will not be persisted on refreshing. You can either use column resizing or filterbar template with persistence. 
  
Kindly get back to us for further assistance. 
  
Regards, 
Padmavathy Kamalanathan 


Marked as answer
Loader.
Up arrow icon