Scandit.Ui.Toolbar.ToolbarButton

new ToolbarButton()

Methods

off(event: string, callback?: function)

Unsubscribe from events. Possible events: click

Parameters:
Name Type Attributes Description
event string

Event name

callback function <optional>

Event callback

Examples
  • JavaScript
  • ES6
// Assuming that 'icon.png' exists at the specified path
var toolbarButton = Scandit.Ui.Toolbar.addButton('assets/icon.png');
...
toolbarButton.off('longClick');
// Assuming that 'icon.png' exists at the specified path
const toolbarButton = Scandit.Ui.Toolbar.addButton('assets/icon.png');
...
toolbarButton.off('longClick');

on(event: string, callback: function)

Subscribe to event. Possible events: click

Parameters:
Name Type Description
event string

Event name

callback function

Event callback

Examples
  • JavaScript
  • ES6
// Assuming that 'icon.png' exists at the specified path
var toolbarButton = Scandit.Ui.Toolbar.addButton('assets/icon.png');
toolbarButton.on('click', function() {
  console.log('Toolbar button was clicked');
});
// Assuming that 'icon.png' exists at the specified path
const toolbarButton = Scandit.Ui.Toolbar.addButton('assets/icon.png');
toolbarButton.on('click', () => {
  console.log('Toolbar button was clicked');
});

remove()

Removes button from the toolbar

Examples
  • JavaScript
  • ES6
// Assuming that 'icon.png' exists at the specified path
var toolbarButton = Scandit.Ui.Toolbar.addButton('assets/icon.png');
...
toolbarButton.remove();
// Assuming that 'icon.png' exists at the specified path
const toolbarButton = Scandit.Ui.Toolbar.addButton('assets/icon.png');
...
toolbarButton.remove();

Events

click

Click event