Skip to main content
PropertyList is a mutable list of ViewModel items. Use it to manage repeating data collections from scripts (for example, menu items, inventory entries, or dynamic UI rows). A PropertyList supports:
  • Reading item count via length
  • 1-based indexed access (list[1], list[2], …)
  • Mutations (push, insert, swap, pop, shift, clear)
  • Change notifications via addListener and removeListener
For a complete working example, see the Scripting Lists demo.

Fields

length

The current number of items in the list.

addListener

Adds a listener that is called when the list changes.

removeListener

Removes a previously added list-change listener.

Methods

push

Get the list item by index.
Adds a view model to the end of the list.

insert

Inserts a view model at the given index.

swap

Swaps the positions of the view models at index1 and index2.

pop

Removes and returns the last view model in the list.

shift

Removes and returns the first view model in the list.

clear

Removes all view models from the list.

remove

Removes a view model from the list.

removeAllOf

Removes every list entry that references the given view model instance.

removeAt

Removes the view model at the given 1-based index from the list.