DHTMLX Docs & Samples Explorer

Adding First Item

Items
Checkboxes
Radios

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"></script>
 
<div style="height: 400px; position: relative;">
    <div id="contextZone_A" style="position: absolute; left: 100px; top: 100px; width: 100px; height: 60px; border: #C1C1C1 1px solid; background-color: #E7F4FF;">Items</div>
    <div id="contextZone_B" style="position: absolute; left: 220px; top: 100px; width: 100px; height: 60px; border: #C1C1C1 1px solid; background-color: #E7F4FF;">Checkboxes</div>
    <div id="contextZone_C" style="position: absolute; left: 340px; top: 100px; width: 100px; height: 60px; border: #C1C1C1 1px solid; background-color: #E7F4FF;">Radios</div>
</div>
 
<br>
<script>
var menu1,
menu2,
menu3;
function doOnLoad() {
    // items;
    menu1 = new dhtmlXMenuObject();
    menu1.renderAsContextMenu();
    menu1.addContextZone("contextZone_A");
    menu1.setIconsPath("../common/imgs/");
    menu1.addNewChild(menu1.topId, 0, "open", "Open", false, "open.gif");
    menu1.addNewChild(menu1.topId, 1, "save", "Save", false, "save.gif");
    menu1.addNewChild(menu1.topId, 3, "close", "Close", false, "close.gif");
    // checkboxes;
    menu2 = new dhtmlXMenuObject();
    menu2.renderAsContextMenu();
    menu2.addContextZone("contextZone_B");
    menu2.addCheckbox("child", menu2.topId, 0, "ignore_case", "Ignore Case", true);
    menu2.addCheckbox("child", menu2.topId, 1, "search_everywhere", "Search Everywhere");
    // radios;
    menu3 = new dhtmlXMenuObject();
    menu3.renderAsContextMenu();
    menu3.addContextZone("contextZone_C");
    menu3.addRadioButton("child", menu3.topId, 0, "red", "Red", "color", true);
    menu3.addRadioButton("child", menu3.topId, 1, "green", "Green", "color");
    menu3.addRadioButton("child", menu3.topId, 2, "blue", "Blue", "color");
}
</script>