跳到主要内容

onToolbarItemClick

Description​

Fires when a toolbar button or menu item is activated

onToolbarItemClick: (id: string | number, item: UIToolbarItem, e?: Event | null) => void | boolean

Parameters​

  • id - the ID of the item, or the ID of the selected leaf in a toolbar menu
  • item - the item descriptor
  • e - the originating event, when available

Example​

gantt.attachEvent("onToolbarItemClick", function (id) {
if (id === "refresh") gantt.render();
return true;
});

Details​

Requires the toolbar plugin. The event fires before a built-in action. Return false to cancel the action. For fields and toggles, also see onToolbarItemChange.

Need help?
Got a question about the documentation? Reach out to our technical support team for help and guidance. For custom component solutions, visit the Services page.