Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Kevin Cook on Dec 17, 2008 03:53
open dhtmlx forum
TreeGrid and key capture (attach event)

I have several treeGrids (//v.1.6 build 80512) which fail to recognize key-press events until AFTER an edit event (a double click).
Even row selection (single click) doesn't help.

I know the key-press isn't being seen because keyboard navigation doesn't work and if I attach a keyPress event handler, that too fails to fire.

Any thoughts on what might be stopping the event bubble-up?

Kevin Cook
Logical Marketing
Answer posted by Support on Dec 17, 2008 05:55
Grid hears the key events on document level, if you have any kind of container between grid and document, which catch key-events ( keypress and keydown ) - the grid may not receive them. 

If problem occurs only in IE , please try to add next line to grid's init

grid.entBox.onbeforedeactivate=function(){}
Answer posted by Kevin Cook on Dec 17, 2008 06:00
The grid is enclosed in a dhtmlxLayout, so perhaps that is part of the problem.
I have since found that if I disable drag/drop, the key-press is seen even if the grid is inside the Layout

Answer posted by Kevin Cook on Dec 17, 2008 06:08
And I have other grids contained in the same dhtmlxLayout which are able to hear the key-press.  These grids do not have drag/drop enabled. 
When I remove the drag/drop enabled grid from the layout container, the keypress is seen. 

The problem clearly occurs only when drag/drop is enabled on a grid inside a layout container.

These behaviors are identical in FF and Chrome.
IE has never shown the keypress problem.
Answer posted by Support on Dec 17, 2008 07:44
Problem still can't be reconstructed - workign sample of grid inside layout with d-n-d enabled sent by email. 

If issue still occurs - please provide any kind of sample , where problem can be reconstructed.