Caplin Trader 5.0.0

Class: module:ct-component/menu/MenuItem

module:ct-component/menu/MenuItem(sDescription, fHandler)

new module:ct-component/menu/MenuItem(sDescription, fHandler)

This is in beta and therefore subject to API changes.

Constructs a MenuItem instance.

Extends:
Parameters:
Name Type Description
sDescription String

Description or name of this menu item.

fHandler function

Action fired when this menu item is clicked.

Extends

Methods

addChangeListener(oListener)

Register to receive menu change events.

Parameters:
Name Type Description
oListener module:ct-component/menu/MenuChangeListener

The listener to be registered.

Inherited From:
Implements:

addMenuItem(oMenuItem)

Add a new menu item to the list of child menu items.

Parameters:
Name Type Description
oMenuItem module:ct-component/menu/Menu

The menu item to be added.

Overrides:
Implements:
See:

getChildren()

A list of either the menu items within a sub-menu, or a grouped set of menu items.

Inherited From:
Implements:

getDescription()

The description of either a single menu item or a sub-menu item.

Inherited From:
Implements:

getHandler()

The handler function that will be invoked when the menu item is clicked.

Inherited From:
Implements:

isEnabled()

Returns true if this menu is currently enabled, and false otherwise.

Inherited From:
Implements:

onMenuChanged()

This call-back is invoked whenever a change occurs; either directly on the menu you have registered the listener on, or also when a change occurs on one of the descendants of that menu.

Inherited From:
Implements:

removeChangeListener(oListener)

Remove a previously registered listener.

Parameters:
Name Type Description
oListener module:ct-component/menu/MenuChangeListener

A previously registered listener.

Inherited From:
Implements:

removeMenuItem(oMenuItem)

Remove an existing menu item from the list of child menu items.

Parameters:
Name Type Description
oMenuItem module:ct-component/menu/Menu

The menu item to be removed.

Overrides:
Implements:
See:

setIsEnabled(bIsEnabled)

Set whether the menu is enabled or not.

Parameters:
Name Type Description
bIsEnabled boolean

Whether to enable or disable the menu item

Inherited From:
Implements: