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

Grid - FilterMenu prevent keydown close filter menu

2 Answers 383 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Terry
Top achievements
Rank 1
Terry asked on 27 Nov 2015, 11:39 AM

Hello,

Im trying to create a way to filter the set of available checkboxes in my filter menu. I have created a dropdown list which specifies the operator and a input field which allows the user to enter a value. The filtering part works however I would like to provide a way to filter the checkboxes when the user presses enter in the input field.

The keyup event on the input field seems to close the filter menu automatically. I have tried to search in the kend.ui.filtermenu.fn._keydown events but no luck there.

You can see the behaviour in: http://dojo.telerik.com/IPAgo

Is there a way I could overwrite the keyup event and prevent the filter menu from closing?

It seems like its bind to the k-textbox class because if i remove the class from the textbox it's working as intended.

Thanks in advance!

 

 

 

2 Answers, 1 is accepted

Sort by
0
Terry
Top achievements
Rank 1
answered on 27 Nov 2015, 01:32 PM
http://dojo.telerik.com/IPAgo/2
0
Accepted
Daniel
Telerik team
answered on 01 Dec 2015, 08:57 AM
Hello Terry,

The popup will not be closed by the filter menu itself but by the submit handler:
e.container.find("[type='submit']").click(function (e) {
    ...
    popup.close();
});
You can bind a keydown handler to the input that prevents the default action on enter in order to prevent submitting the form:
inputFilter.keydown(function (e) {
    if (e.keyCode == 13) {
        e.preventDefault();
    }
});


Regards,
Daniel
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
Grid
Asked by
Terry
Top achievements
Rank 1
Answers by
Terry
Top achievements
Rank 1
Daniel
Telerik team
Share this question
or