DHTMLX Docs & Samples Explorer

Index
dhtmlxtoolbar
API Methods

## Constructor of dhtmlxToolbar

            var toolbar = new dhtmlXToolbarObject(parent, skin);

where

- parent - id of HTML element which will be used as parent ( or object itself )
- skin - name of skin, optional (string)

          <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,
          });

List of supported options

    	toolbar = new dhtmlXToolbarObject({
    		parent:"a_toolbar",
    		onClick:function(){
    			alert("Toolbar item was clicked");
    		}
    	});