UI / TreeView
TreeView Class
Tree View
Hierarchy
↳
TreeView
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 whether to clear the selected item after clicking on the blank (only valid during initialization) Parameters
|
itemIndentAmount
• | • | ||||
---|---|---|---|---|---|
Get the indentation distance of sub items Returns
| Set sub item indentation distance Parameters
|
itemPadding
• | • | ||||
---|---|---|---|---|---|
Get view node margins Returns
| Set view node margins Parameters
|
listItems
• | ||
---|---|---|
Get List Data Returns
|
onItemClicked
• | ||
---|---|---|
Return to click proxy Returns
|
onItemExpansionChanged
• | ||
---|---|---|
Expand status modification agent Returns
|
onItemHoverChanged
• | ||
---|---|---|
Return to hover status change agent Returns
|
onItemRefreshed
• | ||
---|---|---|
Return UI, refresh, generate synchronization proxy Returns
|
onItemReleaseShow
• | ||
---|---|---|
Call when removing the display of child widget, waiting for reuse Returns
|
onItemSelected
• | ||
---|---|---|
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
|
scrollBarStyle
• | ||
---|---|---|
Scroll bar style Returns
|
scrollBarVisible
• | • | ||||
---|---|---|---|---|---|
Scroll bar visibility Returns
| Scroll bar visibility Parameters
|
scrollOffset
• | • | ||||
---|---|---|---|---|---|
Get the current scrollbar offset position Returns
| Set the current scrollbar offset position Parameters
|
selectionMode
• | • | ||||
---|---|---|---|---|---|
Get the selected mode Returns
| Set selected mode Parameters
|
tableRowStyle
• |
---|
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 TreeViewItemDataBase | Usage: target data |
---|
Returns
boolean | Return 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 TreeViewItemDataBase | Usage: New data that needs to be inserted |
---|---|
index number | Usage: inserted position |
regenerateTreeData
• regenerateTreeData(regenItems
): void
other
Re generate tree to refresh data
Parameters
regenItems | TreeViewItemDataBase [] |
---|
removeItem
• removeItem(delItem
): void
other
Remove project node data
Parameters
delItem TreeViewItemDataBase | Usage: 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 TreeViewItemDataBase | Usage: Target positioning project |
---|
setItemExpansion
• setItemExpansion(targetItem
, expandItem
): void
other
Set the expansion status of nodes
Parameters
targetItem TreeViewItemDataBase | Usage: target data |
---|---|
expandItem boolean | Usage: 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 boolean | Usage: Determine modification target: Select/Uncheck |
selectInfo? SelectInfo | - |
toggleItemExpansion
• toggleItemExpansion(targetItem
): void
other
Modify the unfolded state of nodes
Parameters
targetItem TreeViewItemDataBase | Usage: 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 string | Set the UI of the node bound to the view |
---|---|
parent? Canvas | Usage: Create the external parent object of the control with default: null |
inName? string | Usage: Create control name default: null |
Returns
TreeView | Created objects |
---|