DHTMLX Docs & Samples Explorer

Object API Extended Init

Source
<link rel="stylesheet" type="text/css" href="../../codebase/skins/dhtmlxmenu_dhx_skyblue.css">
<script src="../../codebase/dhtmlxcommon.js"></script>
<script src="../../codebase/dhtmlxmenu.js"></script>
<script src="../../codebase/ext/dhtmlxmenu_ext.js" type="text/javascript"></script>
 
<div style="height: 250px;"><div id="menuObj"></div></div>
<script>
var menu;
function initMenu() {
    var menuData = {
        parent: "menuObj",
        icon_path: "../common/imgs/",
        items: [{
            id: "file",
            text: "File",
            items: [{
                id: "new",
                text: "New",
                img: "new.gif"
            }, {
                id: "sep0",
                type: "separator"
            }, {
                id: "open",
                text: "Open",
                img: "open.gif"
            }, {
                id: "save",
                text: "Save",
                img: "save.gif"
            }, {
                id: "saveAs",
                text: "Save As...",
                disabled: true,
                img_disabled: "save_as_dis.gif"
            }, {
                id: "sep1",
                type: "separator"
            }, {
                id: "print",
                text: "Print",
                img: "print.gif"
            }, {
                id: "pageSetup",
                text: "Page Setup",
                disabled: true,
                img_disabled: "page_setup_dis.gif"
            }, {
                id: "sep2",
                type: "separator"
            }, {
                id: "close",
                text: "Close",
                img: "close.gif"
            }]
            }, {
            id: "edit",
            text: "Edit",
            items: [{
                id: "edit_undo",
                text: "Undo",
                img: "undo.gif"
            }, {
                id: "edit_redo",
                text: "Redo",
                img: "redo.gif"
            }, {
                id: "sep3",
                type: "separator"
            }, {
                id: "edit_select_all",
                text: "Select All",
                img: "select_all.gif"
            }, {
                id: "sep4",
                type: "separator"
            }, {
                id: "edit_cut",
                text: "Cut",
                img: "cut.gif"
            }, {
                id: "edit_copy",
                text: "Copy",
                img: "copy.gif"
            }, {
                id: "edit_paste",
                text: "Paste",
                img: "paste.gif"
            }]
            }, {
            id: "help",
            text: "Help",
            items: [{
                id: "about",
                text: "About...",
                img: "about.gif"
            }, {
                id: "help2",
                text: "Help",
                img: "help.gif"
            }, {
                id: "bugrep",
                text: "Bug Reporting",
                img: "bug_reporting.gif"
            }]
            }]
        };
    menu = new dhtmlXMenuObject(menuData);
}
</script>