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

Keypress event on custom editor

1 Answer 2145 Views
This is a migrated thread and some comments may be shown as answers.
Top achievements
Rank 1
Luis asked on 28 Apr 2014, 11:52 PM
Hello Telerik,

I want to handle the "enter" key while keyboard navigation is enabled.

I could handle the keydown event within the tbody.

I need to handle a keypress event in a custom editor too. And here comes the trouble.. I registered a keypress event in the custom editor but is never fired with the "enter" key. The other keys like letters and numbers fire the event.

I could reproduce my code logic here:

am I missing something? My requirement is to handle keydown => keypress => and keyup in the editor.
The keydown and keyup is firing ok. 

Can you help me?

Thank you in advance, 


1 Answer, 1 is accepted

Sort by
Vladimir Iliev
Telerik team
answered on 30 Apr 2014, 03:15 PM
Hi Luis,

Basically the "keypress" event is not fired as it executed after the "keydown" event (used by the Grid) and only if there is a character resulting from it. For more information on the matter you can check the following StackOverflow post:

I would suggest to use the global "keydown" handler to execute your custom code:

$("#grid table").on("keydown", function (e) {
        //if current key is Enter
        if (e.keyCode == 13) {
            //prevent keydown
            var grid = $("#Employees").data("kendoGrid");
            var currentCell = grid.current();

Vladimir Iliev
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Asked by
Top achievements
Rank 1
Answers by
Vladimir Iliev
Telerik team
Share this question