The Diagram widget provides an easy way to define menus you
can associate with nodes and links.
To associate menus with nodes:
-
Use the following markup property:
nodeMenu
: adijit.Menu
associated with nodes.NoteTo access the node, the event handlers in the menu use theDiagram.lastMenuTarget
property, which holds the entity associated with the event.
To associate menus with links:
-
Use the following markup property:
linkMenu
: adijit.Menu
associated with links.NoteTo access the link, the event handlers for the menu use theDiagram.lastMenuTarget
property, which holds the entity associated with the event.
The following markup definitions associate a menu with
diagram nodes:
<div dojoType="dijit.Menu" jsId="nodeMenu" style="display: none;"></div> <div id="diagram" dojoType="ibm_ilog.diagram.widget.Diagram" nodeMenu="nodeMenu"> </div>
These menus work only for graphs created by the Diagram widget,
either by a data store connection or by programmatic calls to createNode, or createLink and createSubgraph.