ListItem:move(index)method

Moves the ListItem to a new position in the List.

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("ListItem:move() sample", 316, 246) local list = ui.List(win, {"Item 1", "Item 2", "Item 3", "Item 4", "Item 5"}, 10, 10) -- Move first item to position 3 list.items[1]:move(3) await win:showasync()