ComboButton click event : ComboButton « 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.form.Button");
        dojo.require("dijit.Menu");

        function save_function() {
           alert("Save");
        }
        function save_as_function(choice) {
           alert("Save As");
        }
    </script>
  </head>
  <body class="tundra">
    <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>
  </body>
</html>










29.56.ComboButton
29.56.1.ComboButton MenuItem click event
29.56.2.ComboButton click event
29.56.3.Add Icon to ComboButton MenuItem