TreeItem:move(index)method

Moves the TreeItem to a new position in the Tree (among siblings).

Parameters

index

A number representing the new position index for the item (1-based).

Return value

This method returns no value.

Example

--! luart-extensions import ui -- create a simple Window local win = ui.Window("TreeItem:move() sample", 316, 246) local tree = ui.Tree(win, {"Item 1", "Item 2", "Item 3", "Item 4", "Item 5"}, 10, 10) -- Move first item to position 3 tree.items[1]:move(3) await win:showasync()