I have tried successfully to create a grid filter with preset options by using FilterMenuInit() and it works fine at the first time.
However, I noticed that function is only called once, but the filter options are reset after some value is applied or the filter is cleared.
In order to reproduce this behavior, the sample from this thread may be used: http://www.telerik.com/forums/how-to-define-a-kendo-grid-column-filter-between-two-dates
In that sample, click on the filter for "Order Date". In the first run, it will display options for gte and lte. Then, simply click on Clear and fire it up again. Now, both filters are set to the option "Is equal to".
Is there any way to work around that issue without also binding to the button actions in the Filter?
7 Answers, 1 is accepted
I am glad to hear that the approach suits in your case. Just a little follow up - for performance optimization you may move the "if" clause outside of the bind event handler:
In this way you will bind to the open event of the OrderDate filter menu only. With the previous approach you are binding the open event of all filter menu popups and are checking inside the event handler if the field is the one you need.
I have a similar situation as OP and I am using the similar code.
There is another bug with the suggested fix . When I select some date in the 'lte' datepicker (second picker) and hit submit.
Next time when I open the filter, the selected date appears in the first datepicker.
The issue can be replicated in the Dojo sample Alexander gave
How do I fix it? Thanks
Update to my earlier question.
Looks like that is the behavior in all the filter controls, not just the custom ones.
Is there any fix for that? Where the earlier search appears in the correct control?
This thread is very old. The example that you reference uses outdated Kendo UI version.
Please upgrade your project to the latest release and let me know if the issue still persists.
Telerik by Progress
For those of us who still haven't been able to dedicate the resources to upgrading to newer Kendo UI versions, your suggestion of attaching event handlers to the menu filter popup dialog works well. Because the older versions of Kendo don't support the filterMenuInit and filterMenuOpen events, equivalent functionality can be implemented by binding an "open" handler to the popup widget when the column filter's "ui" function is executed to create the filter input dialog.
Here is an example of synchronizing a dropdown widget from another widget every time the filter dialog is opened: