Search
Menu Constructor
See Also
 






Initializes a new instance of the Menu class.

Namespace: MindFusion.Common.UI
File: Menu.js

 Syntax

JavaScript  Copy Code

function Menu ([element])

 Parameters

element
Optional.

HTMLElement. The control's associated Dom element.

 Example

The following code creates a new Menu using a <DIV> HTMLElement called "links":

JavaScript  Copy Code

var ui = MindFusion.UI;

document.addEventListener("DOMContentLoaded", function ()
{
  var menu = new ui.Menu(document.getElementById("links"));
  menu.theme = "blue";

  var data = [
     {
        title: "Activities",
        href: "Activities.html",
        items: [
              { title: "Shows how to create an activity timetable. \n" +
      "Planner, Charts, ListView, Virtual Keyboard", cssClass: "description"
              }]
       },
    {
     title: "Chat",
     href: "Chat.html",
     items: [
      { title: "A chat-like application. \n" +
      "WindowHost, ListView, ToolStrip, Tooltip", cssClass: "description"
      }]
    },
       {
        title: "DomInspector",
        href: "DomInspector.html",
        items: [
              { title: "Shows how to build a dynamic tree. \n" +
      "Diagram, TreeView, ListView, Tooltip", cssClass: "description"
              }]
       },
    {
     title: "FlipMatch",
     href: "FlipMatch.html",
     items: [
      { title: "The classic memory game. \n" +
      "Diagram, Dialogs, Gauges", cssClass: "description"
      }]
    },
       {
        title: "ServerLoad",
        href: "ServerLoad.html",
        items: [
              { title: "A sample server load web application. \n" +
      "Diagram, Gauges, Charts", cssClass: "description"
              }]
       },
    {
     title: "SimpleBrowser",
     href: "SimpleBrowser.html",
     items: [
      { title: "A TabControl based web browser application. \n" +
      "TabControl, ToolStrip", cssClass: "description"
      }]
    },
    {
     title: "TemperatureLog",
     href: "TemperatureLog.html",
     items: [
      { title: "A temperature data logger application. \n" +
      "Planner, Charts, Window, Gauges", cssClass: "description"
      }]
    }
    ];

  menu.fromObject(data);
  menu.render();
});

 See Also