cpr.controls.Tree

Tree A control that represents data in the form of a tree.
Hierarchy

Index

Events
Event Description
animationend Event that occurs after the animation ends.
animationstart Event that occurs at the start of the animation.
before-context-value-change Use a bind context in a control that has a bind context An event that occurs before the value changes.
before-selection-change The event that occurs before the selected Item value is saved.
blur An event that occurs after the control loses focus.
click An event that occurs when the user clicks the control.
context-value-change Use a bind context in a control that has a bind context An event that occurs after the value changes.
contextmenu When the right mouse button is clicked or the context menu key is pressed, Event called.
dblclick An event that occurs when the user double-clicks the control.
dispose The event that is called when the control is dispose.
dragend ESC or drag event.
dragenter When the mouse pointer enters the elements included in the control while dragging Events that occur.
dragleave During the drag, the mouse pointer may have exited the elements contained in the control.
dragover While dragging the source control with the mouse, the mouse pointer An event that occurs when moving within a region.
dragstart Event that occurs when dragging the source control with the mouse.
drop Drag the source control to the target control while dragging the source control with the mouse.
focus The event that occurs after the control gains focus.
item-check An event that occurs when an item is checked.
item-click An event that occurs when an item is clicked.
item-dblclick Event that occurs when you double-click an item.
item-uncheck Event when an item is unchecked.
keydown Event raised when the user presses a key.
keyup Event that occurs when the user releases the key.
measure-size Event raised when calculating control size
mousedown When the user presses the mouse button with the pointer over the control Occurs when an event occurs.
mouseenter An event that occurs when the mouse pointer enters the control.
mouseleave If the user moves the mouse pointer beyond the control and its children Events that occur when moving.
mousemove This event is raised when the user moves the pointer over the control.
mouseup The user releases the mouse button while over the control.
node-close An event that occurs when a child node is closed on the parent node of a TreeItem.
node-open An event that occurs when a child node is expanded from the parent node of a TreeItem.
selection-change An event that occurs after the selected Item value is saved.
transitionend Event that fires after CSS property transition ends.
transitionstart Event that fires when CSS property transition starts.
Properties
Name Type Description
accessKey String Returns the keyboard shortcut character.
accessbility Tree$Accessbility Gets the accessibility-related ARIA properties or gets the context in which they can be specified.
allowDrop Boolean Returns whether the drop functionality provided to the control is enabled.
allowLeafDrop Boolean Returns the value of whether the leaf item can be dropped as a child or not.
autoOpen Number Returns the depth value that automatically opens an item.
badgeExp #expression Gets the expression value displayed in the badge.
collapseImage String Returns an image with a collapsed state.
dataSet DataCollection Returns the associated dataset.
delimiter String Returns the delimiter when specifying or retrieving multiple selected values.
displayExp #expression Returns the Expression of the text shown on the screen.
disposed Boolean Returns whether the control should be removed.
draggableItem Boolean Returns whether the item is draggable.
editable Boolean Returns whether the value can be changed by user action.
ellipsis Boolean Returns whether or not to use ellipsis.
enabled Boolean Returns whether the control is enabled.
enabledItemExp #expression Returns the item's enabled expression value.
expandImage String Returns the image in the expanded state.
fieldLabel String Returns the logical field name of the control.
filterExp #expression Returns the value of the expression that filters the item.
focusable Boolean Returns whether the control is focusable.
focused Boolean Returns whether the control has focus.
folderImage String Returns an image of the folder status.
id String Returns the ID of the control.
indent Number Gets the indentation interval for the child tree node.
itemCheckType TreeItemCheckType Whether to check only one or children when checking the item checkbox.
itemSetConfig TreeItemSetConfig ItemSet Returns an object with the column name information of the dataset you set.
leafImage String Returns an image of the leaf state.
multiple Boolean Returns whether the item is multi-selected.
name String Returns the name of the control.
readOnly Boolean Returns whether a non-modifiable read-only mode is in effect.
selectionType TreeItemSelectionType Item Returns the selection type.
showDeletedItem Boolean Returns whether the bound data shows the item in the deleted state.
showItemCheckbox Boolean Returns whether to display a checkbox on the item.
showLines Boolean Returns whether to show the line of the tree.
showRootLines Boolean Returns whether to show the top-level connector and extension icon in the tree.
showSelectionCheckbox Boolean Returns whether the selection should be displayed with a checkbox.
style Tree$Styler Returns the style settings of the control.
tabIndex Number Returns the control focus sequence using the Tab Key.
text String Returns the text displayed on the screen.
tooltip String Returns a description of the control
type ControlType Returns the signature string of the Control's unique Type that can distinguish the Control.
useVirtualScroll Boolean Returns the value of whether to use virtual scrolling.
uuid String Returns the unique ID of the control.
value String Returns the value of the control.
values String[] Sets the array of values ​​stored in the control when multiple selection is made.
visible Boolean Returns the style property for controlling css visibility.
Methods
Name Return Type Description
addEventListener Add listeners by EventType to the control.
addEventListenerOnce (e: cpr.events.CEvent)=>Void Add a listener to the control that will run only once per EventType.
addItem Add items.
bind IBindFactory Bind that property.
blur Removes focus from the control.
clearFilter Removes the filter for the item.
clearSelection Deselect all selected items.
collapseAllItems Collapse all items.
collapseItem Fold the item.
confirmEvent Boolean Determines whether to run the Control's Default Event Handler depending on the state of the Control.
deleteAllItems Remove all items.
deleteItem Remove the item corresponding to the index.
deleteItemByValue Removes the item corresponding to value.
dispatchEvent Boolean Forwards specific events.
dispose Removes the objects that the control contains.
edit Change the state to edit the item.
expandAllItems Expand all items.
expandItem Unfold the item.
findItem TreeItem Find the first item that meets the criteria.
findItems TreeItem[] Find all items that match your criteria.
findParent UIControl Find the parent control.
focus Assigns focus to the control.
focusItem Find the item and position the scroll.
focusNext Moves focus to the next control.
focusPrevious Moves focus to the previous control.
getActualRect Rectangle Gets the bounds value of the control relative to the browser's view port.
getAppInstance AppInstance Returns the App to which the control belongs.
getBindContext BindContext Returns the bind context.
getBindInfo BindInfo Returns the bind property information for the control.
getChecked Boolean Returns whether the item is checked or not
getCheckedItems TreeItem[] Returns items that are checked.
getChildren TreeItem[] Returns the children of the item as an array.
getDataSetIndex Number Returns the index of the dataset as an item.
getDataSetIndexByValue Number Returns the index of the dataset as the value of the item.
getFilter #expression Returns the set filter expression value.
getHtmlAttrNames String[] Returns all custom DOM DATA attribute names.
getIndex Number Returns the Index of the item
getIndexByValue Number Gets the index corresponding to the item's value.
getItem TreeItem Returns the item corresponding to Index.
getItemByValue TreeItem Returns the item corresponding to value.
getItemCount Number Returns the number of items.
getItemEnable Boolean Returns whether an item is active.
getItems TreeItem[] Returns the items.
getItemsByValue TreeItem[] Returns a list of items corresponding to value.
getNextControl UIControl Returns the control to be moved by Tab Key or by the autoskip property.
getOffsetRect Rectangle The area being displayed is obtained based on the parent container to which it belongs.
getParent Container Gets the parent control.
getPrevControl UIControl Shift + Tab Returns the focus to be moved through the key.
getSelectedDataSetIndices Number[] Get the index of the dataset of the selected item.
getSelectedIndices Number[] Get the index of the selected item.
getSelection TreeItem[] Returns the selected items.
getSelectionFirst TreeItem Returns the first data in the selected list data array.
getSelectionLast TreeItem Returns the last data in the selected list data array.
getTreeFilter #expression Gets the tree filter settings.
getUserAttrNames String[] Returns all custom attribute names.
getVisualParentControl UIControl Gets the closest parent UI control.
hasChild Boolean Returns whether the item has children.
htmlAttr Specifies custom DOM properties.
insertItemAfter Insert the item after the reference item.
insertItemBefore Insert the item before the reference item.
isAvailableBinding Boolean Returns whether the queried property is bindable and the binding has been configured to obtain a valid value.
isBindable Boolean Make sure it is a bindable property.
isExpanded Boolean Returns whether the tree item is expanded.
isFloated Boolean Returns whether the control is floating through an app instance or a specific container.
isSelected Boolean Returns whether the item corresponding to the index is selected.
isSelectedByValue Boolean Returns whether the item corresponding to value is selected.
isShowing Boolean Returns the status that the screen is showing.
putValue Sets the value of the control.
putValues Sets the array of values ​​stored in the control when multiple selection is made.
redraw Redraw the control.
removeAllEventListeners Removes all event listeners for the control.
removeAllHtmlAttr Delete all custom DOM DATA attributes.
removeAllUserAttr Delete all custom attributes.
removeEventListener Remove Listener for each EventType in the control.
removeEventListeners Remove all EventType listeners from the control.
removeHtmlAttr Removes the user-defined DOM DATA attribute for a specific attribute name.
removeSelection If an item corresponding to the index is selected, deselect it.
removeSelectionByValue If an item corresponding to value is selected, the item is removed.
removeUserAttr Removes user-defined attributes for a specific attribute name.
revealItem Find the item and position the scroll.
selectItem Select the item corresponding to the index.
selectItemByLabel Select the item corresponding to the label.
selectItemByValue Select the item corresponding to value.
selectItems Select items corresponding to the index array.
setBindContext Sets the bind context.
setChecked Check the item.
setCheckedChildren Only the children of the item set the state.
setCheckedItems Set items to check.
setFilter Use expressions in the list of items to specify filters.
setItemEnable Set whether to activate specific items.
setItemSet Specify the DataSet of the item.
setItems Set up a list of items.
setNextControl Sets the control to be moved by Tab Key or by the autoskip property.
setPrevControl Shift + Tab Set the focus to be moved through the key.
setSubTreeChecked Sets the state of all children of the item.
setTreeFilter Set the value to be filtered in tree form.
toggle Toggles the expand state of the item.
unbind Unbind that property.
userAttr Specifies custom properties.
userData Specifies custom data.
userattr Object Returns a user-defined property.

Constructor

Tree(id)
Create a tree.
Parameters
name type description
idoptional String tree id

Events

animationend
CAnimationEvent Event that occurs after the animation ends.
animationstart
CAnimationEvent Event that occurs at the start of the animation.
before-context-value-change
CValueChangeEvent Use a bind context in a control that has a bind context An event that occurs before the value changes.
before-selection-change
CSelectionEvent The event that occurs before the selected Item value is saved. Selection-change occurs with the following event.
 oldSelection: {cpr.controls.Item []} Previously Selected Index 
 newSelection: {cpr.controls.Item []} The currently selected index 
blur
CFocusEvent An event that occurs after the control loses focus.
click
CMouseEvent An event that occurs when the user clicks the control.
context-value-change
CValueChangeEvent Use a bind context in a control that has a bind context An event that occurs after the value changes.
contextmenu
CMouseEvent When the right mouse button is clicked or the context menu key is pressed, Event called.
dblclick
CMouseEvent An event that occurs when the user double-clicks the control.
dispose
CEvent The event that is called when the control is dispose.
dragend
CMouseEvent ESC or drag event.
dragenter
CMouseEvent When the mouse pointer enters the elements included in the control while dragging Events that occur.
dragleave
CMouseEvent During the drag, the mouse pointer may have exited the elements contained in the control. The event that occurs when.
dragover
CMouseEvent While dragging the source control with the mouse, the mouse pointer An event that occurs when moving within a region.
dragstart
CMouseEvent Event that occurs when dragging the source control with the mouse.
drop
CMouseEvent Drag the source control to the target control while dragging the source control with the mouse. Event that fires when dropping.
focus
CFocusEvent The event that occurs after the control gains focus.
item-check
CItemEvent An event that occurs when an item is checked.
 item: {cpr.controls.Item} item to check 
item-click
CItemEvent An event that occurs when an item is clicked.
 item: {cpr.controls.Item} clicked item object 
 relativeTargetName: {string} The location of the pointer. Displayed as the style element name of the item (treeicon, itemicon, checkbox, text, badge). 
item-dblclick
CItemEvent Event that occurs when you double-click an item.
 item: {cpr.controls.Item} clicked item object 
 relativeTargetName: {string} The location of the pointer. Displayed as the style element name of the item (treeicon, itemicon, checkbox, text, badge). 
item-uncheck
CItemEvent Event when an item is unchecked.
 item: {cpr.controls.Item} item object to uncheck 
keydown
CKeyboardEvent Event raised when the user presses a key. Keycode related constants can be referenced at KeyCode.
keyup
CKeyboardEvent Event that occurs when the user releases the key. Keycode related constants can be referenced at KeyCode.
measure-size
CMeasureSizeEvent Event raised when calculating control size
mousedown
CMouseEvent When the user presses the mouse button with the pointer over the control Occurs when an event occurs.
mouseenter
CMouseEvent An event that occurs when the mouse pointer enters the control.
mouseleave
CMouseEvent If the user moves the mouse pointer beyond the control and its children Events that occur when moving.
mousemove
CMouseEvent This event is raised when the user moves the pointer over the control.
mouseup
CMouseEvent The user releases the mouse button while over the control. When an event occurs.
node-close
CItemEvent An event that occurs when a child node is closed on the parent node of a TreeItem.
node-open
CItemEvent An event that occurs when a child node is expanded from the parent node of a TreeItem.
selection-change
CSelectionEvent An event that occurs after the selected Item value is saved.
 oldSelection: {cpr.controls.Item []} Previously Selected Index 
 newSelection: {cpr.controls.Item []} The currently selected index 
transitionend
CTransitionEvent Event that fires after CSS property transition ends.
transitionstart
CTransitionEvent Event that fires when CSS property transition starts.

Properties

accessKey
declaring type AccessableUIControl
type String
get
Returns the keyboard shortcut character.
set
Keyboard shortcut Sets a single character (letter or number).
The shortcut key is [alt] + [shortcut key] for Windows or [option] + [shortcut key] for Mac.
accessbility
type Tree$Accessbility
readonly
Gets the accessibility-related ARIA properties or gets the context in which they can be specified.
allowDrop
type Boolean
get
Returns whether the drop functionality provided to the control is enabled.
set
Sets whether to use the drop function provided to the control.
allowLeafDrop
type Boolean
get
Returns the value of whether the leaf item can be dropped as a child or not.
set
Set the leaf item to be able to drop as a child.
autoOpen
type Number
get
Returns the depth value that automatically opens an item.
set
Specifies the depth value for automatically opening items. The default is 0. A value of -1 means opening all. If an item is initially opened due to this property, it will not be affected later.
badgeExp
type #expression
get
Gets the expression value displayed in the badge.
set
The mark on the badge sets the value of the expression. If you only set the style, you need to set the width by adding a class.
collapseImage
type String
get
Returns an image with a collapsed state.
set
Sets the folded image.
dataSet
type DataCollection
readonly
Returns the associated dataset.
delimiter
type String
get
Returns the delimiter when specifying or retrieving multiple selected values.
set
Sets the delimiter when specifying or importing multiple selected values.
displayExp
type #expression
get
Returns the Expression of the text shown on the screen.
set
Set the expression of the text shown on the screen.
The values ​​provided for Expression are label and value.
control.displayExp = 'label+"["+value+"]"'
disposed
declaring type Control
type Boolean
readonly
Returns whether the control should be removed.
draggableItem
type Boolean
get
Returns whether the item is draggable.
set
Sets whether the item can be dragged.
editable
declaring type UIControl
type Boolean
readonly
Returns whether the value can be changed by user action.
UIControl (Output, etc.) that does not allow input returns false.
In the case of an inputtable UIControl, returns true if the binding context in which the value is bound is valid.
Otherwise, it returns false even if it is an inputtable UIControl.

Accordion/Button/Group/Dialog/EmbeddedApp/EmbeddedPage/Grid/HTMLObject/Image/MDIFolder/Menu/
NavigationBar/Notifier/Output/Progress/TabFolder/Shell/FileUpload
In the case of the above control, editable is always false.
ellipsis
type Boolean
get
Returns whether or not to use ellipsis.
set
Sets whether or not to use ellipsis.
If set to true, ellipsis is used if there is more content than output size.
enabled
declaring type EnableUIControl
type Boolean
get
Returns whether the control is enabled.
set
Sets whether to activate the control.
enabledItemExp
type #expression
get
Returns the item's enabled expression value.
set
You can set the item's enabled to the column of the dataset bound to the item or the value of label, value. ex) label! = 'label1'
expandImage
type String
get
Returns the image in the expanded state.
set
Sets the image in the expanded state.
fieldLabel
declaring type UIControl
type String
get
Returns the logical field name of the control.
set
Sets the logical field name of the control.
filterExp
type #expression
get
Returns the value of the expression that filters the item.
set
Sets the expression to filter items.
focusable
declaring type UIControl
type Boolean
readonly
Returns whether the control is focusable.
focused
declaring type UIControl
type Boolean
readonly
Returns whether the control has focus.
folderImage
type String
get
Returns an image of the folder status.
set
Set the image for the folder status.
id
declaring type Control
type String
readonly
Returns the ID of the control.
indent
type Number
get
Gets the indentation interval for the child tree node. The default value is 20.
set
Specifies the indentation interval for child tree nodes.
itemCheckType
type TreeItemCheckType
get
Whether to check only one or children when checking the item checkbox.
set
Sets whether to check only one item or children when checking an item checkbox.
itemSetConfig
type TreeItemSetConfig
readonly
ItemSet Returns an object with the column name information of the dataset you set.
leafImage
type String
get
Returns an image of the leaf state.
set
Sets the image of the leaf state.
multiple
type Boolean
get
Returns whether the item is multi-selected.
set
Sets whether to select multiple items.
name
declaring type UIControl
type String
get
Returns the name of the control.
set
Sets the name of the control.
readOnly
declaring type EnableUIControl
type Boolean
get
Returns whether a non-modifiable read-only mode is in effect.
set
Sets whether to enable read-only mode, which can not be modified.
selectionType
type TreeItemSelectionType
get
Item Returns the selection type.
set
Item Selects the selection type. This attribute applies when multiple = true. [allchild]: Selected by including the child nodes of Item. [single]: Only the Item itself is selected.
showDeletedItem
type Boolean
get
Returns whether the bound data shows the item in the deleted state.
set
Set whether to show the item with the bound data deleted.
showItemCheckbox
type Boolean
get
Returns whether to display a checkbox on the item. These checkboxes are for checkmarking purposes, not selection purposes. You can get checked items through the getCheckedItems API.
set
Sets whether to display checkboxes on items. These checkboxes are for checkmarking purposes, not selection purposes.
showLines
type Boolean
get
Returns whether to show the line of the tree.
set
Sets whether to show the tree line. The width of the element that represents the line is determined by the indent attribute.
showRootLines
type Boolean
get
Returns whether to show the top-level connector and extension icon in the tree.
set
Sets whether to show the top connector and extension icon in the tree. The width of the element that represents the line is determined by the indent attribute.
showSelectionCheckbox
type Boolean
get
Returns whether the selection should be displayed with a checkbox. These checkboxes are for checkmark purposes, not checkmarks. You can get the selected items through the getSelection API.
set
Sets whether the selection is displayed with a checkbox. If no value is set, a checkbox is displayed when multiple. These checkboxes are for checkmark purposes, not checkmarks.
style
type Tree$Styler
readonly
Returns the style settings of the control.
In case of style changes, only the corresponding control is updated.
Propagation from style changes does not occur.
tabIndex
declaring type AccessableUIControl
type Number
get
Returns the control focus sequence using the Tab Key.
This property controls the tabindex in HTML.
set
Set the control focus order using Tab Key.
This property controls the tabindex in HTML.
text
type String
readonly
Returns the text displayed on the screen.
tooltip
declaring type VisibleUIControl
type String
get
Returns a description of the control
It works when mouse over.
set
Set a description for the control.
It works when mouse over.
type
declaring type Control
type ControlType
readonly
Returns the signature string of the Control's unique Type that can distinguish the Control. Please refer to ControlType for available constant values. For UDC controls, each unique type name is returned. Example: udc.MyUDC
useVirtualScroll
type Boolean
get
Returns the value of whether to use virtual scrolling.
set
Set whether to use virtual scrolling. Item height works normally only with fixed size.
uuid
declaring type Control
type String
readonly
Returns the unique ID of the control.
value
type String
get
Returns the value of the control.
set
Sets the value of the control.
values
type String[]
get
Sets the array of values ​​stored in the control when multiple selection is made.
set
Returns an array of values ​​stored in the control when multiple selections are made.
visible
declaring type VisibleUIControl
type Boolean
get
Returns the style property for controlling css visibility.
set
Sets the style property to control css visibility.

Methods

addEventListener(type, listener)
declaring typeUIControl
Add listeners by EventType to the control.
Add a listener to the control to handle when a specific event occurs.
var button = new cpr.controls.Button("btn01");
button.addEventListener("click", function(e) {
// event code...
});
Parameters
name type description
type String
listener (e: cpr.events.CEvent)=>Void
addEventListenerOnce(type, listener)
declaring typeUIControl
Add a listener to the control that will run only once per EventType.
Add a listener to the control to handle when a specific event occurs. The added listener is automatically deleted after running once. Since the object of the added listener is changed, when the listener is deleted It is an object returned after calling addEventListenerOnce and can be deleted.
var button = new cpr.controls.Button("btn01");
button.addEventListenerOnce("click", function(e) {
// event code...
});
Parameters
name type description
type String
listener (e: cpr.events.CEvent)=>Void
return (e: cpr.events.CEvent)=>Void The modified Listener object.
addItem(item)
Add items.
Value and label such as combo box, list, radio button, and check box group are cpr.controls.Item. Items such as trees, linked listboxes, and linked comboboxes are cpr.controls.TreeItem. Items such as menus and navigation bars are cpr.controls.MenuItem.
//combobox,list,radiobutton,checkboxgroup
control.addItem(new cpr.controls.Item("label","value"));
//tree,linkedcombobox,linkedlistbox
control.addItem(new cpr.controls.TreeItem("label","value","parentValue"));
//menu,navigationbar
control.addItem(new cpr.controls.MenuItem("label","value","parentValue"));

Parameters
name type description
item TreeItem Item information.
bind(name)
declaring typeUIControl
Bind that property.
Parameters
name type description
name String
return IBindFactory Factory showing bind type.
blur()
declaring typeUIControl
Removes focus from the control.
clearFilter()
Removes the filter for the item.
clearSelection(emitEvent)
Deselect all selected items.
Parameters
name type description
emitEventoptional Boolean defaulttrue Whether to fire an event (before-selection-change, selection-change).
collapseAllItems(root, options)
Collapse all items.
Collapse all items, including sub-items of the item.
If there is no corresponding item, collapse all items in the tree.
control.collapseAllItems (item); // Collapse all children of the item
or
control.collapseAllItems (); // collapse all
 
Parameters
name type description
rootoptional TreeItem defaultnull parent item
optionsoptional { includeRoot?: Boolean, emitEvent?: Boolean } Set whether to generate an event (node-close) and whether to collapse including the root item.
collapseItem(item, emitEvent)
Fold the item. If it is folded, it will not work.
Parameters
name type description
item TreeItem Folded Items
emitEventoptional Boolean defaulttrue Whether to generate an event (node-close)
confirmEvent(e)
declaring typeUIControl
Determines whether to run the Control's Default Event Handler depending on the state of the Control.
Parameters
name type description
e CEvent event
return Boolean Whether the control's event handler is running.
deleteAllItems()
Remove all items.
deleteItem(index)
Remove the item corresponding to the index.
Parameters
name type description
index Number Item index
deleteItem(item)
Remove the item.
Parameters
name type description
item TreeItem item
deleteItemByValue(value)
Removes the item corresponding to value.
Parameters
name type description
value String The value of the item
dispatchEvent(e)
declaring typeUIControl
Forwards specific events.
Parameters
name type description
e CEvent
return Boolean Whether to continue processing the default action after propagating the event.
dispose()
Removes the objects that the control contains.
edit(item, options)
Change the state to edit the item.
Parameters
name type description
item TreeItem Item to edit
optionsoptional { maxLength: Number, lengthUnit?: "ascii" | "char" | "utf8" } maxlength and lengthUnit on edit
expandAllItems(root, options)
Expand all items.
Expand all items, including sub-items of the item.
If there is no corresponding item, all items in the tree are unfolded.
control.expandAllItems (item); // Expand all children of the item
or
control.expandAllItems (); // expand all
 
Parameters
name type description
rootoptional TreeItem defaultnull parent item
optionsoptional { includeRoot?: Boolean, emitEvent?: Boolean } Set whether to generate an event (node-open) and whether to expand including the root item.
expandItem(item, emitEvent)
Unfold the item. It doesn't work if it is open.
Parameters
name type description
item TreeItem Item to be unfolded
emitEventoptional Boolean defaulttrue Whether to generate an event (node-open).
findItem(condition)
Find the first item that meets the criteria.
control.findItem ({value: "001"}); 
control.findItem ({label: "Seoul"});
control.findItem ({value: "001", label: "Seoul"});
Parameters
name type description
condition { label?: String, value?: String, icon?: String, tooltip?: String, parentValue?: String, parentItem?: cpr.controls.TreeItem, depth?: Number, checked?: Boolean } Condition to find item.
return TreeItem The first item that meets the conditions.
findItems(condition)
Find all items that match your criteria.
control.findItems ({label: "Seoul"}); 
Parameters
name type description
condition { label?: String, value?: String, icon?: String, tooltip?: String, parentValue?: String, parentItem?: cpr.controls.TreeItem, depth?: Number, checked?: Boolean } Condition to find item.
return TreeItem[] An array of all items that meet the condition.
findParent(predicate, includeSelf)
declaring typeUIControl
Find the parent control.
If includeSelf is true, the parent including the self is found.
Parameters
name type description
predicate (c: cpr.controls.UIControl)=>Boolean
includeSelfoptional Boolean defaultfalse Whether you include yourself.
return UIControl Parental control.
focus(forward)
declaring typeUIControl
Assigns focus to the control.
Parameters
name type description
forwardoptional Boolean defaulttrue
focusItem(item)
deprecatedThey are removed because they have different functions and actions. Please use revealItem.
Find the item and position the scroll. If there is a scroll, the scroll moves based on the item.
Parameters
name type description
item TreeItem Items to focus on.
focusNext()
declaring typeUIControl
Moves focus to the next control. If there are multiple structural elements that have focus inside a control, focus may transition to the next element.
focusPrevious()
declaring typeUIControl
Moves focus to the previous control. If there are multiple structural elements that have focus inside a control, focus may transfer to the previous element.
getActualRect()
declaring typeUIControl
Gets the bounds value of the control relative to the browser's view port. If the control is not drawn on the screen, an object with all values ​​of 0 is returned.
return Rectangle About the position and size of controls in the HTML DOM
getActualRect(includeWrap)
declaring typeUIControl
Gets the bounds value of the control relative to the browser's view port. If the control is not drawn on the screen, an object with all values ​​of 0 is returned.
Parameters
name type description
includeWrap Boolean If this value is true, the layout of the parent group gets the area of ​​the node surrounding this control. If false, only get the area of ​​the control node.
return Rectangle About the position and size of controls in the HTML DOM
getActualRect(options)
declaring typeUIControl
Gets the bounds value of the control relative to the browser's view port. If the control is not drawn on the screen, an object with all values ​​0 is returned.
Parameters
name type description
options { includeWrap?: Boolean, scaled?: Boolean }
return Rectangle
getAppInstance()
declaring typeUIControl
Returns the App to which the control belongs.
return AppInstance App that belongs
getBindContext()
declaring typeUIControl
Returns the bind context.
return BindContext bind context
getBindInfo(name)
declaring typeUIControl
Returns the bind property information for the control.
Parameters
name type description
name String
return BindInfo BindInfo Properties
getChecked(item)
Returns whether the item is checked or not
Parameters
name type description
item TreeItem item
return Boolean
getCheckedItems()
Returns items that are checked.
return TreeItem[]
getChildren(item)
Returns the children of the item as an array. If you put null, it returns the children of root.
Parameters
name type description
itemoptional TreeItem null | item.
return TreeItem[] An array of item children.
getDataSetIndex(item)
Returns the index of the dataset as an item.
Parameters
name type description
item TreeItem
return Number
getDataSetIndexByValue(value)
Returns the index of the dataset as the value of the item.
Parameters
name type description
value String
return Number
getFilter()
Returns the set filter expression value.
return #expression
getHtmlAttrNames()
declaring typeUIControl
Returns all custom DOM DATA attribute names.
return String[] An array of all custom DOM DATA attribute names.
getIndex(item)
Returns the Index of the item
For nonexistent items, returns -1.
Parameters
name type description
item TreeItem Item information.
return Number Index of corresponding item.
getIndexByValue(value)
Gets the index corresponding to the item's value.
Parameters
name type description
value String The value of the item
return Number The index of the corresponding item.
getItem(index)
Returns the item corresponding to Index.
Parameters
name type description
index Number The index of the item.
return TreeItem Corresponding item.
getItemByValue(value)
Returns the item corresponding to value.
Parameters
name type description
value String The value of the item.
return TreeItem Corresponding item.
getItemCount()
Returns the number of items.
return Number Number of items.
getItemEnable(item)
Returns whether an item is active.
Parameters
name type description
item TreeItem item.
return Boolean Whether the item is active.
getItems()
Returns the items. Gets the filtered List if Filter is applied.
return TreeItem[] An array of items.
getItemsByValue(value)
deprecatedIt is not used because duplicate values ​​are not allowed. Please use getItemByValue.
Returns a list of items corresponding to value.
Parameters
name type description
value String The value of the item.
return TreeItem[] An array of corresponding items.
getNextControl()
declaring typeUIControl
Returns the control to be moved by Tab Key or by the autoskip property.
return UIControl control.
getOffsetRect(includeWrap)
declaring typeUIControl
The area being displayed is obtained based on the parent container to which it belongs.
Parameters
name type description
includeWrapoptional Boolean defaultfalse If this value is true, the layout of the parent group gets the area of ​​the node surrounding this control. If false, only get the area of ​​the control node.
return Rectangle
getParent()
declaring typeUIControl
Gets the parent control.
return Container Parental control.
getPrevControl()
declaring typeUIControl
Shift + Tab Returns the focus to be moved through the key.
return UIControl control.
getSelectedDataSetIndices()
Get the index of the dataset of the selected item. Returns -1 if it is not an item in the dataset.
return Number[]
getSelectedIndices()
Get the index of the selected item.
return Number[]
getSelection()
Returns the selected items.
return TreeItem[] An array of selected items.
getSelectionFirst()
Returns the first data in the selected list data array.
return TreeItem The first selected data.
getSelectionLast()
Returns the last data in the selected list data array.
return TreeItem Last selected data.
getTreeFilter()
Gets the tree filter settings.
return #expression
getUserAttrNames()
declaring typeControl
Returns all custom attribute names.
return String[] An array of all custom attribute names.
getVisualParentControl()
declaring typeUIControl
Gets the closest parent UI control. Unlike getParent(), it finds nearby parent controls, including external apps.
return UIControl
hasChild(item)
Returns whether the item has children.
Parameters
name type description
item TreeItem item.
return Boolean Whether or not there is an item child.
htmlAttr(key, value)
declaring typeUIControl
Specifies custom DOM properties.
Parameters
name type description
key String The attribute name to assign
value String The attribute value to specify.
htmlAttr(key)
declaring typeUIControl
Returns a custom DOM property.
Parameters
name type description
key String The attribute name to get.
return String Custom properties.
htmlAttr(values)
declaring typeUIControl
Specify multiple custom DOM properties at once.
Parameters
name type description
values {[key:string]: String} A JSON object containing custom attribute keys/values.
htmlAttr()
declaring typeUIControl
Get all custom DOM properties in the form of a map.
return {[key:string]: String}
insertItemAfter(item, offset)
Insert the item after the reference item.
Parameters
name type description
item TreeItem The item you want to insert.
offset TreeItem Item to be standardized.
insertItemBefore(item, offset)
Insert the item before the reference item.
Parameters
name type description
item TreeItem The item you want to insert.
offset TreeItem Item to be standardized.
isAvailableBinding(name)
declaring typeUIControl
Returns whether the queried property is bindable and the binding has been configured to obtain a valid value. Even if no binding is configured and a simple value is specified, it is treated as configured so that a valid value is obtained. For example, binding to a row index that does not exist in the DataSet is an invalid binding.
Parameters
name type description
name String
return Boolean
isBindable(name)
declaring typeUIControl
Make sure it is a bindable property.
Parameters
name type description
name String
return Boolean Confirmation.
isExpanded(item)
Returns whether the tree item is expanded.
Parameters
name type description
item TreeItem
return Boolean Whether the tree item is expanded.
isFloated()
declaring typeUIControl
Returns whether the control is floating through an app instance or a specific container.
return Boolean
isSelected(index)
Returns whether the item corresponding to the index is selected.
Parameters
name type description
index Number Item index
return Boolean Whether to select the item at the index.
isSelected(item)
Returns whether the applicable item is selected.
Parameters
name type description
item TreeItem item
return Boolean Whether or not the item is selected.
isSelectedByValue(value)
Returns whether the item corresponding to value is selected.
Parameters
name type description
value String The value of the item.
return Boolean Whether or not the item is selected.
isShowing()
declaring typeUIControl
Returns the status that the screen is showing. Returns false if the visible state of all parents including itself is false.
return Boolean
putValue(value)
Sets the value of the control.
Parameters
name type description
value String The value of the control.
putValues(values)
Sets the array of values ​​stored in the control when multiple selection is made.
Parameters
name type description
values String[] An array of values ​​to be stored in the control.
redraw()
declaring typeUIControl
Redraw the control.
removeAllEventListeners()
declaring typeControl
Removes all event listeners for the control.
removeAllHtmlAttr()
declaring typeUIControl
Delete all custom DOM DATA attributes.
removeAllUserAttr()
declaring typeControl
Delete all custom attributes.
removeEventListener(type, listener)
declaring typeControl
Remove Listener for each EventType in the control.
control.removeEventListener ('click', listener);  
Parameters
name type description
type String Event type.
listener (e: cpr.events.CEvent)=>Void Event listeners.
removeEventListeners(type)
declaring typeControl
Remove all EventType listeners from the control.
control.removeEventListeners ('click');  
Parameters
name type description
type String Event type.
removeHtmlAttr(key)
declaring typeUIControl
Removes the user-defined DOM DATA attribute for a specific attribute name.
Parameters
name type description
key String The custom DOM DATA attribute name to remove.
removeSelection(index, emitEvent)
If an item corresponding to the index is selected, deselect it.
Parameters
name type description
index Number Index of items to deselect
emitEventoptional Boolean Whether to fire an event (before-selection-change, selection-change).
removeSelection(item, emitEvent)
If the corresponding item is selected, deselect it.
Parameters
name type description
item TreeItem Item to deselect
emitEventoptional Boolean Whether to fire an event (before-selection-change, selection-change).
removeSelectionByValue(value, emitEvent)
If an item corresponding to value is selected, the item is removed.
Parameters
name type description
value String The value of the item.
emitEventoptional Boolean defaulttrue Whether to fire an event (before-selection-change, selection-change).
removeUserAttr(key)
declaring typeControl
Removes user-defined attributes for a specific attribute name.
Parameters
name type description
key String The custom attribute name to remove.
revealItem(item, verticalAlign)
Find the item and position the scroll. If there is a scroll, the scroll moves based on the item.
Parameters
name type description
item TreeItem Item to be restored.
verticalAlignoptional ScrollIntoViewAlignType
selectItem(index, emitEvent)
Select the item corresponding to the index.
The value of the selected item is assigned as the value of the control.
control.selectItem (0);
 
Parameters
name type description
index Number Index of the item to be selected.
emitEventoptional Boolean Whether to fire an event (before-selection-change, selection-change).
selectItem(item, emitEvent)
Select the item.
The value of the selected item is assigned as the value of the control.
control.selectItem (item);
 
Parameters
name type description
item TreeItem The item you want to select.
emitEventoptional Boolean Whether to fire an event (before-selection-change, selection-change).
selectItemByLabel(label, emitEvent)
Select the item corresponding to the label.
The value of the selected item is assigned as the value of the control.
control.selectItemByLabel ("label1");
 
Parameters
name type description
label String The label of the item.
emitEventoptional Boolean defaulttrue Whether to fire an event (before-selection-change, selection-change).
selectItemByValue(value, emitEvent)
Select the item corresponding to value.
The value of the selected item is assigned as the value of the control.
control.selectItemByValue ("value1");
 
Parameters
name type description
value String The value of the item.
emitEventoptional Boolean defaulttrue Whether to fire an event (before-selection-change, selection-change).
selectItems(indices, emitEvent)
Select items corresponding to the index array. Deselect the previously selected items and select the items.
Parameters
name type description
indices Number[] Index array of items to select
emitEventoptional Boolean Whether to fire an event (before-selection-change, selection-change).
selectItems(items, emitEvent)
Select those items. Deselects previously selected items and selects them.
Parameters
name type description
items TreeItem[] Array of items to select
emitEventoptional Boolean Whether to fire an event (before-selection-change, selection-change).
setBindContext(context)
declaring typeUIControl
Sets the bind context.
container.setBindContext({dataControl:grid.dataSet,rowIndex:rowIndex})
Parameters
name type description
context BindContext bind context
setChecked(item, state, option)
Check the item.
Parameters
name type description
item TreeItem item
state Boolean Check whether
optionoptional { propagation: Boolean } Function options when checked
setCheckedChildren(item, state)
Only the children of the item set the state.
Parameters
name type description
item TreeItem item
state Boolean Check whether
setCheckedItems(items)
Set items to check.
Parameters
name type description
items TreeItem[] Items
setFilter(condition)
Use expressions in the list of items to specify filters.
control.setFilter ("value == 'value1'");  
Parameters
name type description
condition #expression Filter conditions.
setItemEnable(item, enabled)
Set whether to activate specific items.
Parameters
name type description
item TreeItem item.
enabled Boolean Whether to activate.
setItemSet(dataSet, config)
Specify the DataSet of the item.
 Dataset1.parsedata ({{
Of
	Columns: [
		{Datatype: "String", name: "Dataset_value"},
		{Datatype: "String", name: "dataset_label"},
	],
Of
});
Control.SetitemSet (Dataset1, {Value: "Dataset_value", Label: "Dataset_label"})  
Parameters
name type description
dataSet DataCollection
config TreeItemSetConfig Set items to connect.
setItems(items)
Set up a list of items.
Parameters
name type description
items TreeItem[] An array of items.
setNextControl(nextControl)
declaring typeUIControl
Sets the control to be moved by Tab Key or by the autoskip property.
Parameters
name type description
nextControl UIControl control.
setPrevControl(prevControl)
declaring typeUIControl
Shift + Tab Set the focus to be moved through the key.
Parameters
name type description
prevControl UIControl control.
setSubTreeChecked(item, state)
Sets the state of all children of the item. Recursively the state of the children is set.
Parameters
name type description
item TreeItem item
state Boolean Check whether
setTreeFilter(filterExp)
Set the value to be filtered in tree form. The default behavior is to filter items by finding the parent from the child.
Parameters
name type description
filterExp #expression
toggle(item, emitEvent)
Toggles the expand state of the item.
Parameters
name type description
item TreeItem Item to be converted
emitEventoptional Boolean defaulttrue Whether to generate an event (node-open, node-close)
unbind(name)
declaring typeUIControl
Unbind that property.
Parameters
name type description
name String
userAttr(key, value)
declaring typeControl
Specifies custom properties.
Parameters
name type description
key String The attribute name to assign
value String The attribute value to specify.
userAttr(key)
declaring typeControl
Returns a user-defined property.
Parameters
name type description
key String The attribute name to get.
return String Custom properties.
userAttr(values)
declaring typeControl
Specify multiple custom properties at once.
Parameters
name type description
values {[key:string]: String} A JSON object containing custom attribute keys/values.
userAttr()
declaring typeControl
Get all custom properties in the form of a map.
return {[key:string]: String}
userData(key, value)
declaring typeControl
Specifies custom data. Unlike user-defined attributes, you can use arbitrary types in addition to strings. When the control is dispose, all custom data is removed.
Parameters
name type description
key String The key of the data to be specified.
value Object Data to specify.
userData(key)
declaring typeControl
get custom data
Parameters
name type description
key String The key of the data to get.
return Object
userData(override)
declaring typeControl
Specifies multiple user-defined data.
Parameters
name type description
override {[key:string]: Object} A JSON object containing user-defined data.
userData()
declaring typeControl
Get all your custom data.
return {[key:string]: Object}
userattr()
declaring typeControl
deprecatedPlease use userAttr.
Returns a user-defined property.
return Object Custom properties.