This is a migrated thread and some comments may be shown as answers.

Persistent custom column filters

2 Answers 466 Views
Grid
This is a migrated thread and some comments may be shown as answers.
corey
Top achievements
Rank 1
corey asked on 22 Sep 2017, 04:24 PM

hello,

 

I'm aware that the filters do not carry over using localStorage as the persistence method:

http://demos.telerik.com/kendo-ui/grid/persist-state

I'm currently doing this method of filter customization:

http://demos.telerik.com/kendo-ui/grid/filter-menu-customization

so when using the above system of persistence, the grid returns correctly, and the correct value is applied to the filter, but it is no longer a KendoDropDown menu, just a textbox.

I know using a HeaderTemplate you can restore basic Column header customization's, but I have not found anything that goes as deep as the whole filter menu. Only something as small as a button or checkbox such as this:

http://www.telerik.com/forums/persist-state-issues

 

So, is this possible to merge the first two demos into one? Maintaining the custom filter through grid persistence?

Thanks for any time spent,

-Corey

 

 

2 Answers, 1 is accepted

Sort by
0
Viktor Tachev
Telerik team
answered on 26 Sep 2017, 12:19 PM
Hi Corey,

The behavior you describe is expected because function references are not serialized. Since this is how the filter menu is customized when the options are restored the custom component is not restored. 


In order to persist the custom filters you can get the grid options and specify the custom filters manually. Then reapply the Grid options - this way the custom filters will be restored as expected. Please check out the sample below where the behavior is illustrated.



Regards,
Viktor Tachev
Progress Telerik
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
corey
Top achievements
Rank 1
answered on 26 Sep 2017, 02:24 PM

This works perfectly. I had attempted to do something similar though not on the JSON option, but on the Grid columns after setting the options.

thank you very much for the work!

Tags
Grid
Asked by
corey
Top achievements
Rank 1
Answers by
Viktor Tachev
Telerik team
corey
Top achievements
Rank 1
Share this question
or