Scandit.Ui.Menu.MenuItem

Methods

off(event: string, callback?: function)

Unbinds event callback. Possible events: click

Parameters:
Name Type Attributes Description
event string

Event name

callback function <optional>

Event callback

Examples
  • JavaScript
  • ES6
var menuItem = Scandit.Ui.Menu.addMenuItem('Item label');
...
menuItem.off('click');
const menuItem = Scandit.Ui.Menu.addMenuItem('Item label');
...
menuItem.off('click');

on(event: string, callback: function)

Binds event callback. Possible events: click

Parameters:
Name Type Description
event string

Event name

callback function

Event callback

Examples
  • JavaScript
  • ES6
var menuItem = Scandit.Ui.Menu.addMenuItem('Item label');
menuItem.on('click', function() {
  console.log('The menu item was clicked');
});
const menuItem = Scandit.Ui.Menu.addMenuItem('Item label');
menuItem.on('click', () => {
  console.log('The menu item was clicked');
});

remove()

Removes item from the menu

Examples
  • JavaScript
  • ES6
var menuItem = Scandit.Ui.Menu.addMenuItem('Item label');
...
menuItem.remove();
const menuItem = Scandit.Ui.Menu.addMenuItem('Item label');
...
menuItem.remove();

Events

click

Click event