cpr.controls.MenuItem

MenuItem. An item that has label, value, parentValue, and optionally provides icon and accessKey. Used in menu components with hierarchical structure.
Hierarchy

Index

Properties
Name Type Description
accessKey String Returns the key to access the menu item.
checked Boolean Returns true or false depending on whether or not it is checked.
children TreeItem[] Returns child items.
depth Number Returns the depth value of an item.
expanded Boolean Returns whether the item is expanded.
icon String Get the URL of the icon representing the item.
label String Returns the text to be displayed for the item.
parentItem MenuItem Returns the parent's item.
parentValue String Get the parent's value.
row Row For items bound to the dataset, it returns a Row.
tooltip String Get the tooltip value for an item.
value String Returns the value of item.
Methods
Name Return Type Description
bind IBindFactory Bind that attribute.
getBindContext BindContext Returns the bind context.
hasAncestor Boolean Find the parent item with value.
isBindable Boolean Returns whether the property is bound.
toExpressionContext BindContext Creates an input context object to execute an expression expression that takes a given item as input.

Constructor

MenuItem(label, value, parentValue)
Create a menu item.
Parameters
name type description
label String displayed text
value String identifying value
parentValue String parent identification value

Properties

accessKey
type String
get
Returns the key to access the menu item.
set
Set the key to access menu items. Must be a single character (letter or number).
checked
declaring type TreeItem
type Boolean
get
Returns true or false depending on whether or not it is checked.
set
Check it.
children
declaring type TreeItem
type TreeItem[]
readonly
Returns child items.
depth
declaring type TreeItem
type Number
readonly
Returns the depth value of an item.
expanded
declaring type TreeItem
type Boolean
readonly
Returns whether the item is expanded.
icon
declaring type Item
type String
get
Get the URL of the icon representing the item.
set
Specifies the URL of the icon representing the item.
label
declaring type Item
type String
get
Returns the text to be displayed for the item.
set
Sets the text to be displayed for the item.
parentItem
type MenuItem
readonly
Returns the parent's item.
parentValue
declaring type TreeItem
type String
get
Get the parent's value.
set
Set the parent's value.
row
declaring type Item
type Row
readonly
For items bound to the dataset, it returns a Row. If none, it returns null.
tooltip
declaring type Item
type String
get
Get the tooltip value for an item.
set
Set a tooltip on the item.
value
declaring type Item
type String
get
Returns the value of item.
set
Set the value of item.

Methods

bind(name)
declaring typeItem
Bind that attribute. Items in datasets do not support binding.
Parameters
name type description
name String The attribute name to bind.
return IBindFactory
getBindContext()
declaring typeItem
Returns the bind context.
return BindContext bind context
hasAncestor(value)
declaring typeTreeItem
Find the parent item with value. Returns true if present.
Parameters
name type description
value String
return Boolean
isBindable(name)
declaring typeItem
Returns whether the property is bound. Items in datasets do not support binding.
Parameters
name type description
name String Attribute name
return Boolean
toExpressionContext(control)
declaring typeItem
Creates an input context object to execute an expression expression that takes a given item as input.
Parameters
name type description
controloptional UIControl defaultnull Own control. If this value is not given, the ID selector within the expression will not work.
return BindContext