But I’ve tried that and while it works on the document.body, Datagrok seems to handle this event for all viewers in order to show the custom menu. Stay tuned, we’ll figure out a way to prevent it.
This approach is much better than handling the context menu using mouse events. The only question is how to remove the default menu items? It seems like I can only add new items:
args.args.menu.items([“New Item 1”, “New Item 2”]);
It would be logical to completely override the default context menu by calling
That’d be great to have! There is another small issue with the context menu.
The statement below appends the items to the context menu only for right mouse clicks originated from regular Grid cells. For column header cells the statement is ignored.
We’ve just added the following method for the Menu class: find, remove, and clear. Here are the sources (latest version will be deployed on dev in an hour):