DHTMLX Docs & Samples Explorer

attachEvent(original, catcher, CallObj)

Required library edition: This method works with any edition of DHTMLX library
Required library file: dhtmlxtoolbar.js

attach an event handler to webbar

  • original - event original name;
  • catcher - event handler;
  • CallObj - object which will call event.

Several handlers can be attached to one and the same event, and all of them will be executed.

Note: the names of the events are case-insensitive.

    toolbar.attachEvent("onClick", function(itemId){});
    // or
    function doOnClick(itemId){
        // code here
    }
    toolbar.attachEvent("onClick", doOnClick);