ToolbarButton Class
Description
Configurable toolbar button for use as a custom toolbar item.
Syntax
ToolbarButtonExamples
The following example demonstrates ToolbarButton in a practical Document Viewer workflow. This object provides functionalities for controlling the button of the toolbar.
function configureApproveButton(toolbarButton) {
toolbarButton.title = "Approve document";
toolbarButton.onclick = () => console.log("Document approved.");
toolbarButton.enable();
toolbarButton.show();
}Members
Properties
| Property | Description |
|---|---|
| image | URL assigned to the button image. |
| name | Name assigned to the item. If no name is assigned, the constructor name is used. |
| onclick | Click callback, or `null` when no action is assigned. |
| src | Alias for image. |
| title | Tooltip text displayed for the toolbar item. |
Methods
| Method | Description |
|---|---|
| activate | Applies the active visual state. |
| createElement | Returns the element inserted into a toolbar. Repeated calls return the same element. |
| deactivate | Removes the active visual state. |
| disable | Disables interaction with the toolbar button. |
| enable | Enables interaction with the toolbar button. |
| hide | Hides the complete toolbar item. |
| isActive | Reports whether the toolbar button has its active visual state. |
| show | Shows the complete toolbar item. |