var toolbar = new dhtmlXToolbarObject(parent, skin);
where
<div id='my_toolbar_here' style="width: 500px;"></div> <script> //common init code var toolbar = new dhtmlXToolbarObject("my_toolbar_here"); </script>
Layout, Window, Accordion, Tabbar can create a menu inside their cells by using
// attach to dhtmlxLayout dhxLayout.attachToolbar(); dhxLayout.cells(id).attachToolbar(); // attach to dhtmlxWindow dhxWins.window(id).attachToolbar(); // attach to dhtmlxAccordion dhxAcc.cells(id).attachToolbar(); // attach to dhtmlxTabbar dhxTabbar.cells(id).attachToolbar();
Starting from 2.5 version, menu can be initialized by object notation
var toolbar = new dhtmlXToolbarObject({ some_option1:some_value_1, some_option2:some_value_2, ... some_optionN:some_value_N, });
toolbar = new dhtmlXToolbarObject({ parent:"a_toolbar", onClick:function(){ alert("Toolbar item was clicked"); } });