Type representing a viewer's toolbar item.

Example

Usage example:

var pdfExportButton: ToolbarItem = {
key: '$pdfExportButtonKey',
checked: true,
enabled: true,
iconCssClass: 'mdi mdi-file-pdf',
text: 'Export to PDF',
title: 'Export to PDF',
action: function(item) {
console.log('Export to PDF function works here');
},
onUpdate: function(arg, item) {
console.log('Something in viewer was updated, check/update button state here');
}
};
viewer.toolbar.desktop.addItem(pdfExportButton);

Hierarchy

  • ToolbarItem

Properties

action: (() => void)

Type declaration

    • (): void
    • Action handler for the toolbar item.

      Returns void

checked?: boolean

Shows whether the toolbar item is checked.

enabled?: boolean

Shows whether the toolbar item is enabled.

iconCssClass?: string

Specifies css class for the icon of the toolbar item.

key: string

The uniq identifier of the toolbar item. See keys of the standard viewer's toolbar buttons here: [[ToolbarButtons]]

onUpdate: (() => ToolbarItem)

Type declaration

text?: string

Specifies the text of the toolbar item.

title?: string

Specifies the tooltip of the toolbar item.