keydown event

2 posts, 0 answers
  1. Naga gopichand
    Naga gopichand avatar
    3 posts
    Member since:
    Aug 2016

    Posted 18 Aug 2016 Link to this post

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


  2. Stefan
    Stefan avatar
    2611 posts

    Posted 22 Aug 2016 Link to this post

    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:

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

    Telerik by Progress
    Get started with Kendo UI in days. Online training courses help you quickly implement components into your apps.
Back to Top