Right click in here to get the contextual menu : Popup Context Menu « Dojo toolkit « JavaScript DHTML






Right click in here to get the contextual menu

 

<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>

   
  








Dojo-toolkit.zip( 3,849 k)

Related examples in the same category

1.ContextMenu setup