Context menu on left click and right click

Hey guys!

I’m developing a diagramming tool that utilizes a right-click context menu to display information in a non-editable text box. However, the need for a button list context menu to be implemented as well and I was wondering what the best way to implement both would be? I’m thinking a left click would show the non editable text box of information and the right click would open a normal context menu of buttons, however I have no idea which property to set for a left click context menu.


You have several choices.

One possibility is to show the read-only text information in a selection Adornment. But this would mean that when multiple nodes are selected, you would be showing multiple text information. Is that what you want?

Another possibility is to implement your text information as a ToolTip. (See Basic GoJS Sample for examples of both tooltips and context menus on nodes and on groups and on links and in the background.) That way the user doesn’t even have to click. And it works on touch devices too, when the user touches a node or link.

Yet another possibility is to implement a click event handler on your node or link to show the tooltip, so that hovering over the node or link is not required.