Caplin Trader 5.1.0

Interface: module:ct-menu/Model

module:ct-menu/Model

The abstract class Model represents an item that can be inserted into a menu with some default enable/disable functionality.

Members

(static) ACTION_EVENT :String

The name of the event that is emitted when an action is activated.

Type:
  • String

Methods

actionActivator()

This method will emit the action event.

The method will usually be called by a module:ct-menu/control/ItemGenerator when it determines that the action of this item needs to be executed (on item click for instance).

getEventName() → {String}

Returns the string name if it exists, null if it doesn't.

Returns:
Type
String

getParent() → {module:ct-menu/Model}

Returns the parent model if it exists, null if it doesn't.

Returns:

The parent model

Type
module:ct-menu/Model

getType() → {String}

Returns the type in string format.

Returns:
Type
String

isEnabled() → {Boolean}

Returns true if the item is enabled, otherwise false.

Returns:
Type
Boolean

setEnabled(enabled)

Sets the enabled property. It then emits an 'enabled-changed' event in case the property has changed.

Parameters:
Name Type Description
enabled Boolean

True if item is enabled false if it is not.

setParent(parent)

This method will be called by a menu each time an item gets inserted.

Parameters:
Name Type Description
parent module:ct-menu/model/Menu

The parent menu.

(inner) areAllNodesToRootEnabled() → {boolean}

Returns true if the model and its ancestors are enabled, otherwise false.

Returns:
Type
boolean