Hi, I have a requirement for my work to make the right click on Grid work as close as possible to Excel.
Is it possible and if yes, what would be the best approach for these:
Select a task line on right click and unselect all selected task lines (and still show onContextMenu)
While holding CTRL, select a task line on right click and keep selected tasks selected (and still show onContextMenu)
While holding ALT, select a task line on right click and select all task lines in between (and still show onContextMenu)
Basically, they want the right click to act like a left click on selection, and still show the onContextMenu (like in Excel)
This is a for a proof of concept. From what I read, there is the onRightClick event that could be used, but unsure how to replicate the CTRL and ALT behaviour of the left click.
Please let me know if this is feasible, thank you so much.
Hello Karl,
DHTMLX Gantt wasn’t created as a replacement for Excel. So, it won’t have the same features out of the box. You need to configure it and implement the features you need.
You can add the code for selecting and unselecting the tasks before the code that shows the context menu.
Select a task line on right click and unselect all selected task lines (and still show onContextMenu)
While holding ALT, select a task line on right click and select all task lines in between (and still show onContextMenu)
To detect the click with the Alt key, you need to check the altKey from the event argument.
Then you need to implement a custom solution for selecting a range of tasks.