This is a migrated thread and some comments may be shown as answers.
The datetimepicker filter is not properly persisted after saving and loading the state of the grid
2 Answers 3 Views
This is a migrated thread and some comments may be shown as answers.
El Mehdi
Top achievements
Rank 1
El Mehdi asked on 04 Sep 2020, 09:27 AM

Hi,

I am facing an odd behavior with the kendo grid menu datetimepicker filter.

Replication (link https://dojo.telerik.com/aFOMARUq):
1- Filter the grid using the "Start" column (select any date or time).
2- Save grid state.
3- Load the grid state.
Check the "Start" column filter.

Observed behavior: the time picker is no longer displayed.

Is there something I am missing? any help or suggestions are much appreciated.

2 Answers, 1 is accepted

Sort by
0
Accepted
Georgi
Telerik team
answered on 07 Sep 2020, 08:11 AM

Hi Mehdi,

The JSON.stringify is not capable of serializing function references, so before applying the options you have to manually restore the reference to the filterable.ui setting.

e.g.

              if (options) {
                var parsedOptions = JSON.parse(options)
                console.log(parsedOptions)
                parsedOptions.columns[1].filterable.ui = dateTimePickerFilter;
               ...

Below you will find a modified version of the provided sample:

Regards,
Georgi
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

0
El Mehdi
Top achievements
Rank 1
answered on 07 Sep 2020, 10:32 AM
Hi Georgi,

That's exactly what I was looking for.

Much appreciated,
Mehdi
Tags
Grid
Asked by
El Mehdi
Top achievements
Rank 1
Answers by
Georgi
Telerik team
El Mehdi
Top achievements
Rank 1
Share this question
or