[]
        
(Showing Draft Content)

ToolbarItem

Interface: ToolbarItem

Type representing a viewer's toolbar item.

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

Properties

action()

action: () => void;

Action handler for the toolbar item.

Returns

void


checked?

optional checked: boolean;

Shows whether the toolbar item is checked.


enabled?

optional enabled: boolean;

Shows whether the toolbar item is enabled.


iconCssClass?

optional iconCssClass: string;

Specifies css class for the icon of the toolbar item.


key

key: string;

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


onUpdate()

onUpdate: () => ToolbarItem;

The function called to update toolbar item state.

Returns

ToolbarItem


text?

optional text: string;

Specifies the text of the toolbar item.


title?

optional title: string;

Specifies the tooltip of the toolbar item.