I want to preload a set of filters on initial load of the grid. The reason for this is that I am planning to store the last selected filter in a session variable so the user will come back to the grid as he left it the last time.
I know there is an option to set defaultValue under editoptions for one column, but I am looking for a way to load the whole filter at once. (Not a function for each coulmn).
I suppose that you use advanced searching for the filtering. The filter is nothing more as the value of postData.filters
. See here and the demo from another old answer for details.
Moreover I would recommend you to read the demo where I describe how to use localStorage
to save some user preferences of the grid inclusive the searching filter. Moreover I describe why I think the usage of the localStorage
the better way as the usage of cookies or session variables.
In the column options, add the defaultValue parameter inside the searchoptions option:
searchoptions:{ sopt:['eq'], defaultValue:"SomeValue" }
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With