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

keydown event

1 Answer 1007 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Naga gopichand
Top achievements
Rank 1
Naga gopichand asked on 18 Aug 2016, 10:40 PM

http://dojo.telerik.com/awIja/3

My keydown event does not work when navigatable is set to false.Can i get a solution for this.

 

1 Answer, 1 is accepted

Sort by
0
Stefan
Telerik team
answered on 22 Aug 2016, 01:02 PM
Hello Naga,

The keydown event is not fired when the navigatable property of the Grid is set to false because the Kendo UI Grid table does not have focus. The event is only fired for elements that have the focus like form elements (textboxes, etc) or non-form elements with a tabindex attribute. When the navigatable property of the Grid is set to true, the Grid table has a tabindex attribute, so it can receive focus and the keydown event is fired.

Also, I noticed that the selectable property of the Grid is set to 'multiple cell'. I can suggest two approaches depending on if multiple selection is required or not:

1) Without multiple selection - add a tabindex attribute to the Grid' table after initialization. After the user clicks on the Grid, the Grid table will be focused, and the keydown event can be fired:

grid.table[0].tabIndex = 0;

2) With multiple selection enabled, the mousedown event is prevented, and the Grid table cannot be focused. I can suggest manually focusing the table in the change event of the Grid:

http://docs.telerik.com/kendo-ui/api/javascript/ui/grid#events-change

Let me know if you need additional information on this matter.

Regards,
Stefan
Telerik by Progress
 
Get started with Kendo UI in days. Online training courses help you quickly implement components into your apps.
Tags
Grid
Asked by
Naga gopichand
Top achievements
Rank 1
Answers by
Stefan
Telerik team
Share this question
or