ContextMenu setup : Popup Context Menu « Dojo toolkit « JavaScript Tutorial






<html>
  <head>
    <link rel="StyleSheet" type="text/css" href="js/dojo/dijit/themes/tundra/tundra.css">
    <script type="text/javascript">
      var djConfig = {
        baseScriptUri : "js/dojo/",
        parseOnLoad : true
      };
    </script>
    <script type="text/javascript" src="js/dojo/dojo/dojo.js"></script>
    <script>
      dojo.require("dojo.parser");
      dojo.require("dijit.Menu");
    </script>
  </head>
  <body class="tundra">
        Right click to see the context menu.
        <div dojoType="dijit.Menu" contextMenuForWindow="true"
          style="display:none;">
          <span dojoType="dijit.MenuItem"
            onClick="alert('Item 1')">Item 1</span>
          <span dojoType="dijit.MenuSeparator"></span>
          <span dojoType="dijit.MenuItem"
            onClick="alert('Item 2')">Item 2</span>
        </div>
  </body>
</html>








29.61.Popup Context Menu
29.61.1.Right click in here to get the contextual menu
29.61.2.ContextMenu setup