DHTMLX Docs & Samples Explorer

Initializing from Script

Source
<script type="text/javascript" src="../../codebase/dhtmlxcommon.js"></script>
<script type="text/javascript" src="../../codebase/dhtmlxtoolbar.js"></script>
<link rel="stylesheet" type="text/css" href="../../codebase/skins/dhtmlxtoolbar_dhx_skyblue.css"></link>
 
<div style="height: 150px; width: 800px;"><div id="toolbarObj"></div></div>
<script>
function doOnLoad() {
    var toolbar = new dhtmlXToolbarObject("toolbarObj");
    toolbar.setIconsPath("../common/imgs/");
    var newOpts = Array(Array('new_text', 'obj', 'Text Document', 'text_document.gif'), Array('new_excel', 'obj', 'Stylesheet', 'stylesheet.gif'), Array('new_db', 'obj', 'Database', 'database.gif'), Array('new_pp', 'obj', 'Presentation', 'presentation.gif'), Array('new_s1', 'sep'), Array('new_other', 'obj', 'Other', 'other.gif'));
    toolbar.addButtonSelect("new", 0, "New", newOpts, "new.gif", "new_dis.gif");
    toolbar.addSeparator("sep1", 1);
    toolbar.addButton("open", 2, "", "open.gif", "open_dis.gif");
    toolbar.addButton("save", 3, "", "save.gif", "save_dis.gif");
    toolbar.addButton("save_as", 4, "Save As...", "save_as.gif", "save_as_dis.gif");
    toolbar.disableItem("save_as");
    toolbar.addSeparator("sep2", 5);
    toolbar.addButton("undo", 6, "", "undo.gif", "undo_dis.gif");
    toolbar.addButton("redo", 7, "", "redo.gif", "redo_dis.gif");
    toolbar.addSeparator("sep3", 8);
    toolbar.addButton("cut", 9, "Cut", "cut.gif", "cut_dis.gif");
    toolbar.addButton("copy", 10, "Copy", "copy.gif", "copy_dis.gif");
    toolbar.addButton("paste", 11, "Paste", "paste.gif", "paste_dis.gif");
    toolbar.addSeparator("sep4", 12);
    var printOpts = Array(Array('print_page', 'obj', 'Page', 'page.gif'), Array('print_range', 'obj', 'Page Range', 'page_range.gif'), Array('print_sel', 'obj', 'Selection', 'selection.gif'), Array('print_sep1', 'sep'), Array('print_cfg', 'obj', 'Settings', 'settings.gif'));
    toolbar.addButtonSelect("print", 13, "Print", printOpts, "print.gif", "print_dis.gif");
    toolbar.addSeparator("sep5", 14);
    toolbar.addText("info", 15, "dhtmlxToolbar Demo");
}
</script>