dijit.MenuBarItem¶
Contents
Status: | Draft |
---|---|
Version: | 1.3 |
Authors: | Bill Keese |
These are the items in the Menubar that may be clickable but does not spawn a submenu when pressed or hovered over.
A programatically created MenuBarItem¶
<script type="text/javascript"> dojo.require("dijit.MenuBar"); dojo.require("dijit.MenuBarItem"); var pMenuBar; function fClickItem() {alert("Clicked on first item")}; function fClickAnotherItem() {alert("Clicked on the second Item!")}; dojo.addOnLoad(function(){ pMenuBar = new dijit.MenuBar({id:"SampleMenu"}); pMenuBar.addChild(new dijit.MenuBarItem({label:"MenuBarItem#1 ", disabled:true, onClick:fClickItem})); pMenuBar.addChild(new dijit.MenuBarItem({label:"MenubarItem#2 ", onClick:fClickAnotherItem})); pMenuBar.placeAt("wrapper"); pMenuBar.startup(); }); </script>
<div id="wrapper"></div>
Creation from markup is more simpler and structured.
<script type="text/javascript"> dojo.require("dijit.MenuBar"); dojo.require("dijit.Menu"); dojo.require("dijit.MenuBarItem"); </script>
<div id="menubar" dojoType="dijit.MenuBar"> <div dojoType="dijit.MenuBarItem" onclick="alert('Clicked on BarMenuItem');"> Click me! </div> <div dojoType="dijit.MenuBarItem" disabled = "true"> Disabled item </div> </div>
Table Of Contents
Previous topic
Next topic
This Page
Quick search
Enter search terms or a module, class or function name.