Skip to content
TreeView

UI / TreeView

TreeView Class

Tree View

Hierarchy

Table of contents

Properties

click

Properties

onCustomPropertyChange: Readonly<MulticastDelegate<(path: string, value: unknown, oldValue: unknown) => void>> other
Monitor custom attribute synchronization events

Accessors

clearSelectionOnClick(clearSelection: boolean): void other
Set whether to clear the selected item after clicking on the blank (only valid during initialization)
itemIndentAmount(): number other
Get the indentation distance of sub items
itemPadding(): Margin
Get view node margins
listItems(): readonly TreeViewItemDataBase[] other
Get List Data
onItemClicked(): MulticastDelegate<(clickedItem: TreeViewItemDataBase, doubleClick: boolean) => void> other
Return to click proxy
onItemExpansionChanged(): MulticastDelegate<(targetItem: TreeViewItemDataBase, expanded: boolean) => void> other
Expand status modification agent
onItemHoverChanged(): MulticastDelegate<(targetItem: Widget, hovered: boolean) => void> other
Return to hover status change agent
onItemRefreshed(): MulticastDelegate<(rowDatas: TreeViewItemDataBase[]) => void> other
Return UI, refresh, generate synchronization proxy
onItemReleaseShow(): MulticastDelegate<(targetItem: Widget) => void> other
Call when removing the display of child widget, waiting for reuse
onItemSelected(): MulticastDelegate<(selectedItem: TreeViewItemDataBase, selectType: SelectInfo) => void> other
Return to select and modify the proxy. Unchecking/clearing will also trigger the selection and modification process. The returned parameter is selectedItem==null. Please pay attention to the judgment
scrollBarStyle(): ScrollbarStyle other
Scroll bar style
scrollBarVisible(): boolean other
Scroll bar visibility
scrollOffset(): number other
Get the current scrollbar offset position
selectionMode(): SelectionMode other
Get the selected mode
tableRowStyle(): ListItemStyle other
Item Item Node style Settings
click

Accessors

alignPosition(): Readonly<Vector2> other
Get the align position of the widget. When the align method is right align, bottom align, and center align, the value of alignPosition is different from that of position;
autoSizeHorizontalEnable(): boolean other
Get whether to automatically set the size horizontally
autoSizeVerticalEnable(): boolean other
Get whether to set the size automatically vertical
cachedGeometry(): Geometry other
Get the previous Get TickSpaceGeometry
constraints(): Readonly<UIConstraintAnchors> other
Get the layout of the control
desiredSize(): Vector2 other
Obtain expected size
enable(): boolean other
Is it available
guid(): string other
Get the widget GUID
isHovered(): boolean other
Is it hovered
mouseCursor(): MouseCursor other
Get the cursor type on the widget
name(): string other
Get Name
paintSpaceGeometry(): Geometry other
Get the last geometric information used to render the Widget
parent(): Widget other
Get parent node
pivot(): Vector2 other
Get the position of the widget anchor. This property determine the relative position of the widget graph and the anchor; At (0,0), the anchor point is located in the upper left corner of the control; (0.5,0.5), the anchor is at the center of the widget
position(): Readonly<Vector2> other
Get the position of the control
renderOpacity(): number other
Obtain rendering transparency
renderScale(): Vector2 other
Get rendering scaling
renderShear(): Vector2 other
Obtain rendering misalignment deformation
renderTransformAngle(): number other
Obtain the rendering angle
renderTransformPivot(): Vector2 other
Get Render anchor
size(): Vector2 other
Get size
tickSpaceGeometry(): Geometry other
Retrieve the last geometric information used to drive Widget Tick
transform(): Readonly<UITransform> other
Obtain the size and position of the control
visibility(): SlateVisibility other
Get visibility
visible(): boolean other
Is it visible
zOrder(): number other
Get Zorder

Methods

addItems(newListItems: TreeViewItemDataBase[]): void other
Add project node data
clearItems(): void other
Clean up data group
clearSelection(): void other
Clear the selection of the list
getExpandedItems(): TreeViewItemDataBase[] other
Get all expanded nodes
getItemExpansion(targetItem: TreeViewItemDataBase): boolean other
Get the expansion status of the node
getSelectionItems(): TreeViewItemDataBase[] other
Retrieve data from the selected node
getShowItemsCount(): number other
Get the number of items currently displayed
insertItem(newItem: TreeViewItemDataBase, index: number): void other
Insert project node data, and if the position is out of bounds, automatically insert the last one
regenerateTreeData(regenItems: TreeViewItemDataBase[]): void other
Re generate tree to refresh data
removeItem(delItem: TreeViewItemDataBase): void other
Remove project node data
requestRefresh(): void other
refresh data
resetListItems(newListItems: TreeViewItemDataBase[]): void other
Reset project node data group
scrollIntoView(targetItem: TreeViewItemDataBase): void other
The scroll bar is positioned to the position of the corresponding item
setItemExpansion(targetItem: TreeViewItemDataBase, expandItem: boolean): void other
Set the expansion status of nodes
setSelectionItem(selectedItems: TreeViewItemDataBase TreeViewItemDataBase[], selected: boolean, selectInfo?: SelectInfo): void other
Set node selection
toggleItemExpansion(targetItem: TreeViewItemDataBase): void other
Modify the unfolded state of nodes
newObject(uiAssetGUID: string, parent?: Canvas, inName?: string): TreeView other
Create TreeView widget. When the parent and inName are the same as the existing object, the old object will be destroyed
click

Methods

addChild(child: Widget): void other
Add child nodes
clone(position: Vector2, Parent?: any): Widget other
Clone the UI widget and its child nodes to the specified parent widget position (default to its parent node)
destroyObject(): void other
Remove and destroy immediately. Cannot be used again
equal(that: Widget): boolean other
Determine if it is the same object
findChildByPath(inPath: string): Widget other
Find nodes by relative path
getChildAt(index: number): Widget other
What is the position node to obtain
getChildByName<T: extends Widget<T>>(name: string): T: extends Widget<T> other
Search for nodes by name
getChildrenCount(): number other
Obtain the number of child nodes
getCustomProperties(): string[] other
Get all customize property
getCustomProperty<T: extends CustomPropertyType>(propertyName: string): T: extends CustomPropertyType other
Get customize property
getCustomPropertyChangeDelegate(property): Readonly<MulticastDelegate<(path: string, value: unknown, oldValue: unknown) => void>> other
Event proxy triggered when a given object property is modified
invalidateLayoutAndVolatility(): void other
Immediately trigger re rendering and layout calculation
removeAllChildren(): void other
Clearing all child nodes will destroy the UI and render it unusable
removeChild(child: Widget): void other
Removing a node will destroy the UI and make it unusable
removeChildAt(index: number): void other
Removing the third node will destroy the UI and render it unusable
removeObject(): void other
Immediately remove and add to the root node for reuse
serialize(): string other
Serialize UI widget
setCustomProperty(propertyName: string, value: undefined CustomPropertyType): void other
Set custom attributes
deserialize(Data: string, Parent?: Widget): Widget other
Deserialize UI

Properties

Accessors


clearSelectionOnClick

set clearSelectionOnClick(clearSelection): void other

Set whether to clear the selected item after clicking on the blank (only valid during initialization)

Parameters

clearSelectionboolean

itemIndentAmount

get itemIndentAmount(): number other

set itemIndentAmount(itemIndentAmount): void other

Get the indentation distance of sub items

Returns

numberReturn the indentation distance of sub items

Set sub item indentation distance

Parameters

itemIndentAmount numberUsage: Offset, specific value must be>=0, negative numbers have no effect

itemPadding

get itemPadding(): Margin

set itemPadding(padding): void

Get view node margins

Returns

MarginMargin data

Set view node margins

Parameters

padding MarginSet margin data

listItems

get listItems(): readonly TreeViewItemDataBase[] other

Get List Data

Returns

readonly TreeViewItemDataBase[]Return list data

onItemClicked

get onItemClicked(): MulticastDelegate<(clickedItem: TreeViewItemDataBase, doubleClick: boolean) => void> other

Return to click proxy

Returns

MulticastDelegate<(clickedItem: TreeViewItemDataBase, doubleClick: boolean) => void>Return to click proxy

onItemExpansionChanged

get onItemExpansionChanged(): MulticastDelegate<(targetItem: TreeViewItemDataBase, expanded: boolean) => void> other

Expand status modification agent

Returns

MulticastDelegate<(targetItem: TreeViewItemDataBase, expanded: boolean) => void>Return to expand status and modify proxy

onItemHoverChanged

get onItemHoverChanged(): MulticastDelegate<(targetItem: Widget, hovered: boolean) => void> other

Return to hover status change agent

Returns

MulticastDelegate<(targetItem: Widget, hovered: boolean) => void>Return to Select Modify Proxy

onItemRefreshed

get onItemRefreshed(): MulticastDelegate<(rowDatas: TreeViewItemDataBase[]) => void> other

Return UI, refresh, generate synchronization proxy

Returns

MulticastDelegate<(rowDatas: TreeViewItemDataBase[]) => void>Return UI, refresh, generate synchronization proxy

onItemReleaseShow

get onItemReleaseShow(): MulticastDelegate<(targetItem: Widget) => void> other

Call when removing the display of child widget, waiting for reuse

Returns

MulticastDelegate<(targetItem: Widget) => void>Return to Select Modify Proxy

onItemSelected

get onItemSelected(): MulticastDelegate<(selectedItem: TreeViewItemDataBase, selectType: SelectInfo) => void> other

Return to select and modify the proxy. Unchecking/clearing will also trigger the selection and modification process. The returned parameter is selectedItem==null. Please pay attention to the judgment

Returns

MulticastDelegate<(selectedItem: TreeViewItemDataBase, selectType: SelectInfo) => void>Return to Select Modify Proxy

scrollBarStyle

get scrollBarStyle(): ScrollbarStyle other

Scroll bar style

Returns

ScrollbarStyle

scrollBarVisible

get scrollBarVisible(): boolean other

set scrollBarVisible(bVisible): void other

Scroll bar visibility

Returns

boolean

Scroll bar visibility

Parameters

bVisibleboolean

scrollOffset

get scrollOffset(): number other

set scrollOffset(scrollOffset): void other

Get the current scrollbar offset position

Returns

numberReturn the current scrollbar offset position

Set the current scrollbar offset position

Parameters

scrollOffset numberUsage: offset, 0 as initial, 1 as final

selectionMode

get selectionMode(): SelectionMode other

set selectionMode(newSelectionMode): void other

Get the selected mode

Returns

SelectionModeReturn to selected mode

Set selected mode

Parameters

newSelectionMode SelectionModeUsage: Select mode

tableRowStyle

get tableRowStyle(): ListItemStyle other

Item Item Node style Settings

Returns

ListItemStyle

Methods


addItems

addItems(newListItems): void other

Add project node data

Parameters

newListItems TreeViewItemDataBase[]Usage: New dataset

clearItems

clearItems(): void other

Clean up data group


clearSelection

clearSelection(): void other

Clear the selection of the list


getExpandedItems

getExpandedItems(): TreeViewItemDataBase[] other

Get all expanded nodes

Returns

TreeViewItemDataBase[]Return all expanded nodes

getItemExpansion

getItemExpansion(targetItem): boolean other

Get the expansion status of the node

Parameters

targetItem TreeViewItemDataBaseUsage: target data

Returns

booleanReturn whether the node is expanded

getSelectionItems

getSelectionItems(): TreeViewItemDataBase[] other

Retrieve data from the selected node

Returns

TreeViewItemDataBase[]Return the data of the selected node

getShowItemsCount

getShowItemsCount(): number other

Get the number of items currently displayed

Returns

number

insertItem

insertItem(newItem, index): void other

Insert project node data, and if the position is out of bounds, automatically insert the last one

Parameters

newItem TreeViewItemDataBaseUsage: New data that needs to be inserted
index numberUsage: inserted position

regenerateTreeData

regenerateTreeData(regenItems): void other

Re generate tree to refresh data

Parameters

regenItemsTreeViewItemDataBase[]

removeItem

removeItem(delItem): void other

Remove project node data

Parameters

delItem TreeViewItemDataBaseUsage: Data that needs to be removed

requestRefresh

requestRefresh(): void other

refresh data


resetListItems

resetListItems(newListItems): void other

Reset project node data group

Parameters

newListItems TreeViewItemDataBase[]Usage: New data set for replacement

scrollIntoView

scrollIntoView(targetItem): void other

The scroll bar is positioned to the position of the corresponding item

Parameters

targetItem TreeViewItemDataBaseUsage: Target positioning project

setItemExpansion

setItemExpansion(targetItem, expandItem): void other

Set the expansion status of nodes

Parameters

targetItem TreeViewItemDataBaseUsage: target data
expandItem booleanUsage: Expand or not

setSelectionItem

setSelectionItem(selectedItems, selected, selectInfo?): void other

Set node selection

Parameters

selectedItems TreeViewItemDataBase TreeViewItemDataBase[]Usage: Need to modify the selected node data
selected booleanUsage: Determine modification target: Select/Uncheck
selectInfo? SelectInfo-

toggleItemExpansion

toggleItemExpansion(targetItem): void other

Modify the unfolded state of nodes

Parameters

targetItem TreeViewItemDataBaseUsage: target data

newObject

Static newObject(uiAssetGUID, parent?, inName?): TreeView other

Create TreeView widget. When the parent and inName are the same as the existing object, the old object will be destroyed

Parameters

uiAssetGUID stringSet the UI of the node bound to the view
parent? CanvasUsage: Create the external parent object of the control with default: null
inName? stringUsage: Create control name default: null

Returns

TreeViewCreated objects