UI / ListView
ListView Class
List 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) |
itemPadding(): Margin |
| Get view node margins |
listItems(): ListViewItemDataBase[] other |
| Get List Data |
onItemClicked(): MulticastDelegate<(clickedItem: ListViewItemDataBase, doubleClick: boolean) => void> other |
| Return to click proxy |
onItemHoverChanged(): MulticastDelegate<(targetItem: Widget, hovered: boolean) => void> other |
| Return to hover status change agent |
onItemRefreshed(): MulticastDelegate<(rowDatas: ListViewItemDataBase[]) => 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: ListViewItemDataBase, 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: ListViewItemDataBase[]): void other |
|---|
| Add project node data |
clearItems(): void other |
| Clean up data group |
clearSelection(): void other |
| Clear the selection of the list |
findItemByIndex(index: number): ListViewItemDataBase other |
| Find the corresponding project node data according to the index. If the position is out of range, it will return null |
getSelectionIndexs(): number[] other |
| Retrieve the index of the selected node |
getSelectionItems(): ListViewItemDataBase[] other |
| Retrieve data from the selected node |
insertItem(newItem: ListViewItemDataBase, index: number): void other |
| Insert project node data, and if the position is out of bounds, automatically insert the last one |
removeItem(delItem: ListViewItemDataBase): void other |
| Remove project node data |
removeItemByIndex(delIndex: number): void other |
| Remove the project node data according to the index. If the position is out of range, the removal fails |
requestRefresh(): void other |
| refresh data |
resetListItems(newListItems: ListViewItemDataBase[]): void other |
| Reset project node data group |
scrollIntoView(targetItem: ListViewItemDataBase): void other |
| The scroll bar is positioned to the position of the corresponding item |
setSelectionItem(selectedItems: ListViewItemDataBase ListViewItemDataBase[], selected: boolean, selectInfo?: SelectInfo): void other |
| Set node selection |
setSelectionItemByIndex(selectedIndexs: number number[], selected: boolean, selectInfo?: SelectInfo): void other |
| Select according to the index setting node. If the position is out of range, the corresponding operation is invalid |
newObject(orientation: Orientation, uiAssetGUID: string, parent?: Canvas, inName?: string): ListView other |
| Create a ListView control, and when the parent and inName are the same as an 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
|
itemPadding
• | • | ||||
|---|---|---|---|---|---|
Get view node margins Returns
| Set view node margins Parameters
|
listItems
• | ||
|---|---|---|
Get List Data Returns
|
onItemClicked
• | ||
|---|---|---|
Return to click proxy 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 ListViewItemDataBase[] | Usage: New dataset |
|---|
clearItems
• clearItems(): void other
Clean up data group
clearSelection
• clearSelection(): void other
Clear the selection of the list
findItemByIndex
• findItemByIndex(index): ListViewItemDataBase other
Find the corresponding project node data according to the index. If the position is out of range, it will return null
Parameters
index number | Usage: the position of the data to be searched |
|---|
Returns
ListViewItemDataBase | Return the found data |
|---|
getSelectionIndexs
• getSelectionIndexs(): number[] other
Retrieve the index of the selected node
Returns
number[] | Return the index of the selected node |
|---|
getSelectionItems
• getSelectionItems(): ListViewItemDataBase[] other
Retrieve data from the selected node
Returns
ListViewItemDataBase[] | Return the data of the selected node |
|---|
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 ListViewItemDataBase | Usage: New data that needs to be inserted |
|---|---|
index number | Usage: inserted position |
removeItem
• removeItem(delItem): void other
Remove project node data
Parameters
delItem ListViewItemDataBase | Usage: Data that needs to be removed |
|---|
removeItemByIndex
• removeItemByIndex(delIndex): void other
Remove the project node data according to the index. If the position is out of range, the removal fails
Parameters
delIndex number | Usage: Location of data to be removed |
|---|
requestRefresh
• requestRefresh(): void other
refresh data
resetListItems
• resetListItems(newListItems): void other
Reset project node data group
Parameters
newListItems ListViewItemDataBase[] | 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 ListViewItemDataBase | Usage: Target positioning project |
|---|
setSelectionItem
• setSelectionItem(selectedItems, selected, selectInfo?): void other
Set node selection
Parameters
selectedItems ListViewItemDataBase ListViewItemDataBase[] | Usage: Need to modify the selected node data |
|---|---|
selected boolean | Usage: Determine modification target: Select/Uncheck |
selectInfo? SelectInfo | Usage: selection method: keyboard/navigation/mouse/direct selection |
setSelectionItemByIndex
• setSelectionItemByIndex(selectedIndexs, selected, selectInfo?): void other
Select according to the index setting node. If the position is out of range, the corresponding operation is invalid
Parameters
selectedIndexs number number[] | Usage: Need to modify the index where the selected node is located |
|---|---|
selected boolean | Usage: Determine modification target: Select/Uncheck |
selectInfo? SelectInfo | Usage: selection method: keyboard/navigation/mouse/direct selection |
newObject
• Static newObject(orientation, uiAssetGUID, parent?, inName?): ListView other
Create a ListView control, and when the parent and inName are the same as an existing object, the old object will be destroyed
Parameters
orientation Orientation | orientation |
|---|---|
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
ListView | Created objects |
|---|
Editor API