Class: MenuItem

Kekule.Widget. MenuItem

Methods

(static) createFromHash(parentOrElementOrDocument, defHash) → {Kekule.Widget.MenuItem}

A class method to create menu item from a definition hash. If input parameter is string rather than hash, it will be regarded as menu text. If the text is '-', a separator will be created.
Parameters:
Name Type Description
parentOrElementOrDocument Variant
defHash Hash
Source:
Returns:
Type
Kekule.Widget.MenuItem

addSubMenu(subMenu)

Add sub menu to this item.
Parameters:
Name Type Description
subMenu Kekule.Widget.Menu
Source:

createSubMenu() → {Kekule.Widget.Menu}

Create a new sub menu under this item.
Source:
Returns:
Type
Kekule.Widget.Menu

getSubMenu(canCreate) → {Kekule.Widget.Menu}

Returns sub menu of this menu item.
Parameters:
Name Type Description
canCreate Bool If no sub menu exists, create a new one.
Source:
Returns:
Type
Kekule.Widget.Menu

isLeafItem() → {Bool}

Returns whether this menu item has no sub menu.
Source:
Returns:
Type
Bool

removeSubMenu(subMenu)

Remove sub menu from item.
Parameters:
Name Type Description
subMenu Kekule.Widget.Menu
Source:

Events

check

Invoked when menu item is checked. event param of it has field: {widget}
Source: