Then, we will add a menu to the layout. Something, like this:
We won't provide any handlers for the menu's items - just will place a menu on the page as a part of the overall interface.
To add a menu to the layout, we need to use the dhtmlxMenu component. The component takes data in the XML or JSON format and allows you to attach menu to the whole layout or an individual layout's cell.
dhtmlxMenu, as many other DHTMLX components, uses various images to be rendered on the page. There are 2 types of these images:
'index.html' file
dhtmlxEvent(window,"load",function(){
var layout = new dhtmlXLayoutObject(document.body,"2U");
layout.cells("a").setText("Contacts");
layout.cells("b").setText("Contact Details");
layout.cells("b").setWidth(500);
var menu = layout.attachMenu();});
menu.setIconsPath("icons/");
'menu.xml' file
<?xml version="1.0"?>
<menu>
<item id="fTop" text="File"> //1st item
<item id="ftNWin" text="New Window"/> //1 sub-item
<item id="ftPrint" text="Print" enabled="false" imgdis="printer.png"/>
<item id="fts0" type="separator"/>//'separator' splits level in 2 parts
<item id="ftQuit" text="Quit"/>
</item>
<item id="eTop" text="Edit" enabled="false"/> //2nd item
<item id="hTop" text="Help" enabled="false"/> //3rd item
</menu>
menu.loadStruct("data/menu.xml");