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

Escape key not firing cancel event

9 Answers 506 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Enrique
Top achievements
Rank 1
Enrique asked on 15 May 2014, 05:38 PM
Hello,

I have a problem with kendo grid. When i press the ESC key , the cancel event is never fired.

I try to create keydown event for the grid, but i can't call the method cancel of the grid, the keydown is never fired neither.

I prepared a sample replicating the behavior: http://trykendoui.telerik.com/OvuT/4

How I can handle the cancel event when the user presses the esc key??

Thank you in advance.

Regards

9 Answers, 1 is accepted

Sort by
0
Kiril Nikolov
Telerik team
answered on 19 May 2014, 09:46 AM
Hello Enrique,

The problem comes from the fact that you have put the bind() method outside the scope of the document.ready. Please check the updated example:

http://trykendoui.telerik.com/@Kiril/IgUn

Regards,
Kiril Nikolov
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Enrique
Top achievements
Rank 1
answered on 23 May 2014, 03:10 PM
Thanks. I saw your example. 

I continue with the problem, I tried un-commenting the lines that call the cancel method. However, the alert of the "cancel" function is not showing.

What I am missing?
0
Enrique
Top achievements
Rank 1
answered on 23 May 2014, 03:11 PM
Sorry, I forgot to attach my updated example with the uncommented lines:
http://trykendoui.telerik.com/aSOq
0
Kiril Nikolov
Telerik team
answered on 26 May 2014, 08:39 AM
Hi Enrique,

The cancel event is fired correctly, here is a short video of my test:

http://www.screencast.com/t/abzflaBie

Please keep in mind that the cancel event is fired when the user clicks the "cancel" button (in inline or popup editing mode) or closes the popup window.

Regards,
Kiril Nikolov
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Enrique
Top achievements
Rank 1
answered on 30 May 2014, 03:23 PM
I invite you to read my thread carefully to really understand my issue.

I am asking for your help to solve a problem, and I all get so far is a "that is how it works" response. 

My problem is that the ESCAPE KEY (please read the title of my thread) is not firing the cancel event. I need to handle the cancel event with the cancel button (that works ok) and when the user press the escape key. 

I hope you can help me. 

Thank you in advance.
0
Kiril Nikolov
Telerik team
answered on 02 Jun 2014, 07:44 AM
Hello Enrique,

You can use the event argument of the keydown event to detect the keycode of the key pressed and act accordingly. Please check the following example:

http://trykendoui.telerik.com/@Kiril/IgUn

Regards,
Kiril Nikolov
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Enrique
Top achievements
Rank 1
answered on 03 Jun 2014, 03:28 PM
Maybe my question is not very clear.

Please see my updated example and the question at line #85.
0
Enrique
Top achievements
Rank 1
answered on 03 Jun 2014, 03:29 PM
http://trykendoui.telerik.com/exUX
0
Kiril Nikolov
Telerik team
answered on 04 Jun 2014, 08:31 AM
Hello Enrique,

Then just use the jQuery trigger() method to trigger any event your want - in your case cancel. You can check it out in the jQuery documentation:

http://api.jquery.com/trigger/

Regards,
Kiril Nikolov
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
Enrique
Top achievements
Rank 1
Answers by
Kiril Nikolov
Telerik team
Enrique
Top achievements
Rank 1
Share this question
or