Contents
This is an item in a Menubar that may be clickable but does not spawn a submenu when pressed or hovered over.
require([ "dijit/MenuBar", "dijit/MenuBarItem", "dojo/domReady!" ], function(MenuBar, MenuBarItem){ var pMenuBar = new MenuBar({}); pMenuBar.addChild(new MenuBarItem({ label: "Click me" })); pMenuBar.placeAt("wrapper"); pMenuBar.startup(); });
<div id="wrapper"></div>
Creation from markup is simpler and more structured.
<div id="menubar" data-dojo-type="dijit/MenuBar"> <div data-dojo-type="dijit/MenuBarItem" data-dojo-props="onClick:function(){alert('Clicked on BarMenuItem');}"> Click me! </div> <div data-dojo-type="dijit/MenuBarItem" data-dojo-props="disabled:true"> Disabled item </div> </div>
See dijit.MenuBar.