Frameworks| Hibernate| Struts| JSF| JavaFX| Ajax| Spring| DOJO| JDO| iBatis| Questions?

 

 

 

 

 

 

 

 

 

 

 

 

 

Search Tutorials

Latest Questions
Comments
 
Dojo Menu and Menu Item 
 

In this section, you will learn about the menu and how to create it in dojo.

 

Dojo Menu and Menu Item

                          

In this section, you will learn about the menu and how to create it in dojo.

Try Online: Menu and Menu Item

Menu : This is the widget models a context menu, otherwise known as a right-click or popup menu, and it appears in a ComboButton and DropDownButton widgets. If you click on the right button of the mouse then popup menu is appeared on the screen.

MenuItem widgets are an actual items in the menu. The PopupMenuItem is a MenuItem, but it displays a submenu or other widget to the right . A PopupMenuItems always have two child nodes: a tag with the displayed label (Using SPAN tag), and a widget to be popped up, typically a dijit.Menu widget.

 

Here is code of program:

<html>
<head>
<title>Menu Demo</title>
    <style type="text/css">
      @import "../resources/dojo.css";
      @import "../dijit/themes/tundra/tundra.css";
      
  </style>
    <script type="text/javascript" src="dojo.xd.js" 
   djConfig="parseOnLoad: true"></script>

  <script type="text/javascript">
       dojo.require("dojo.parser");
     dojo.require("dijit.form.Button");
       dojo.require("dijit.Menu");
     function call_function(choice) {
              alert(choice+" was clicked.");
        }
    function save_function() {
              alert("Save Button");
        }
        function save_as_function(choice) {
             alert("Save As Button");
        }
     </script>
</head>
<body class="tundra">
<b>Creating DropDownButtons</b><br>
<div dojoType="dijit.form.ComboButton" onclick="save_function">
    <span>File</span>
            <div dojoType="dijit.Menu" id="saveMenu" 
   toggle="fade" style="display: none;">
                <div dojoType="dijit.MenuItem"
                     iconClass="dijitEditorIcon dijitEditorIconSave" 
    onclick="save_function">
                    Save
                </div>
                <div dojoType="dijit.MenuItem" onclick="save_as_function">
                    Save As
                </div>
            </div>
        </div>
<div dojoType="dijit.form.DropDownButton">
            <span>Edit</span>
            <div dojoType="dijit.Menu" id="Edit">
                <div dojoType="dijit.MenuItem" label="Copy"
                        onclick="call_function('copy');"></div>
                <div dojoType="dijit.MenuItem" label="Cut" 
                        onclick="call_function('cut');"></div>
                <div dojoType="dijit.MenuItem" label="Paste"
                        onclick="call_function('paste');"></div>
            </div>
        </div>

  
<br><br><br><br><br><br>  
<h1>Submenu</h1>
        <style>
        .myIcon {
           background-image:
              url
(
http://o.aolcdn.com/dojo/1.0.0/dijit/themes/tundra/images/checkmark.gif);
           background-position: -16px 0px;
           width: 16px;
           height: 16px;
        }
        </style>
       
        <div dojoType="dijit.Menu" id="submenu1"
                 contextMenuForWindow="true">
                <div dojoType="dijit.MenuItem" iconClass="myIcon"
                     onClick="alert('Hello world');">Enabled Item</div>
                <div dojoType="dijit.PopupMenuItem" id="submenu2">
                    <span>Submenu</span>
                    <div dojoType="dijit.Menu">
                                <div dojoType="dijit.MenuItem"
                                     onClick="alert('Submenu 1!')">
Submenu Item One</div>

                                <div dojoType="dijit.MenuItem"
                                     onClick="alert('Submenu 2!')">
Submenu Item Two</div>

                    </div>
                </div>
        </div>
</body>
</html>

Here is code of program:

Submenu:

 

 

Try Online:

                          

» View all related tutorials
Related Tags: c dojo io accordion this ai container learn ear e il section in nt out j do s is ll

Leave your comment:

Name:

Email:

URL:

Title:

Comments:


Enter Code:

Audio Version
Reload Image
 

Note: Emails will not be visible or used in any way, and are not required. Please keep comments relevant. Any content deemed inappropriate or offensive may be edited and/or deleted.

No HTML code is allowed. Line breaks will be converted automatically. URLs will be auto-linked. Please use BBCode to format your text.

Add This Tutorial To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Training Courses
Tell A Friend
Your Friend Name
Software Solutions
Least Viewed
Most Rated
Recently Viewed
Search Tutorials

 

 
 

Home | JSP | EJB | JDBC | Java Servlets | WAP  | Free JSP Hosting  | Search Engine | News Archive | Jboss 3.0 tutorial | Free Linux CD's | Forum | Blogs

About Us | Advertising On RoseIndia.net  | Site Map

India News

Indian Software Development Company | iPhone Development Company in India | Flex Development Company in India | Java Training Delhi | Java Training at Noida |

Send your comments, Suggestions or Queries regarding this site at roseindia_net@yahoo.com.

Copyright © 2008. All rights reserved.