cpr.controls.TreeItem

Items of Tree, LinkedCombobox, and LinkedListbox. An item that has label, value, and parentValue and provides an icon as an option. Used in tree components with a hierarchical structure.
Hierarchy

Index

Properties
Name Type Description
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 TreeItem 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

TreeItem(label, value, parentValue)
Creates a tree item.
Parameters
name type description
label String The displayed text of the tree item.
value String The value of the tree item.
parentValue String The value of the item's parent item.

Properties

checked
type Boolean
get
Returns true or false depending on whether or not it is checked.
set
Check it.
children
type TreeItem[]
readonly
Returns child items.
depth
type Number
readonly
Returns the depth value of an item.
expanded
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 TreeItem
readonly
Returns the parent's item.
parentValue
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)
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