I’m trying to capture mouse and keyboard events in the grid area of the gantt chart but I am not able to do so by adding my own event handlers to elements in the grid area. It seems like the dhtmlx gantt chart seems to stop the propagation of any keyboard or mouse events so I am not able to register my own event handlers for these events. Is there a way I can handle keyboard and mouse events in the grid area with my own event handlers? Thanks.
There is keyboard navigation that allows interacting the whole grid or chart. You can assign custom shortcuts and apply them to tasks:
onContextMenu event handlers:
You can use the
window object to assign the shortcuts and check that the mouse is over the grid:
As for the last approach
I can not use this approach in react env. do you have any idea to handle this issue?
Here is an example in the React framework:
We are configuring the Keyboard navigation in our application. In case of Indent/ Outdent of any task/ WBS using keyboard shortcut (Shift+ Left/Right), task update is fired by the gantt. However, we want to stop the default action and execute a custom code for giving proper WBS id and sortorder to the newly added tasks and to the tasks for which these parameters have changed due to new task additions. Can you please guide us to stop the default behaviour and use our custom code?
When you add a custom keyboard shortcut that uses the same keys, it replaces the existing configuration. And that includes the default action. But you need to correctly specify the scope:
Here is an example: