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
action Activator()
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).
get Event Name() → {String}
Returns the string name if it exists, null if it doesn't.
Returns:
- Type
- String
get Parent() → {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
get Type() → {String}
Returns the type in string format.
Returns:
- Type
- String
is Enabled() → {Boolean}
Returns true if the item is enabled, otherwise false.
Returns:
- Type
- Boolean
set Enabled(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. |
set Parent(parent)
This method will be called by a menu each time an item gets inserted.
Parameters:
Name | Type | Description |
---|---|---|
parent |
module:ct-menu |
The parent menu. |
(inner) are All Nodes ToRoot Enabled() → {boolean}
Returns true if the model and its ancestors are enabled, otherwise false.
Returns:
- Type
- boolean