Right click in here to get the contextual menu : 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.MenuItem");
            dojo.require("dijit.Menu");
    </script>
  </head>
  <body class="tundra">
    <body class="tundra">
    Right click in here to get the contextual menu.
    <div id="context" style="background:#eee; height:300px; width:300px;"></div>
    <div dojoType="dijit.Menu" targetNodeIds="context" style="display:none">
        <div dojoType="dijit.MenuItem">foo
            <script type="dojo/method" event="onClick" args="evt">alert("foo");</script>
        </div>
        <div dojoType="dijit.MenuItem">bar
            <script type="dojo/method" event="onClick" args="evt">alert("bar");</script>
        </div>
        <div dojoType="dijit.MenuItem">baz
            <script type="dojo/method" event="onClick" args="evt">alert("baz");</script>
        </div>
    </div>
    </body>
  </body>
</html>








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