class

ItemSelection

@Js
class ItemSelection : Obj

ItemSelection provides APIs to work with selected Items.

fields data

Get or set single selection by Item.data

dataList

Get or set multiple selection by Item.data

id

Get or set single selection by Item.id

ids

Get or set multiple selection by Item.id

item

Get or set single selection by Item

items

Get or set multiple selection by Item

max

Max entries to retain, or zero for unlimited

mru

Most-recently-used ordering

methods add

Add item to the selection

canSelect

Is this item eligible to be selected

clear

Clear the selection

contains

Is the given item currently selected (keyed by id)

enabled

Return if selection should be enabled for given select mode

isEmpty

Is the current selection empty

one

Return if size is one

oneOrMore

Return if size is one or more

remove

Remove item from the selection by id (no-op if not present)

size

Return number of selected items

toggle

Toggle item in the selection

add Void add(Item item)

Add item to the selection. In mru mode the item moves to the front and re-adding an existing item refreshes its recency; otherwise it is appended to the end. Overflow past max evicts the oldest. No-op in append mode if already present. Respects mode (single replaces, disabled is a no-op).

canSelect virtual Bool canSelect(Item item)

Is this item eligible to be selected. Advisory for UI enablement; does not gate add. Anything selected can always be removed, so there is no corresponding removal predicate.

clear Void clear()

Clear the selection

contains Bool contains(Item item)

Is the given item currently selected (keyed by id)

data Obj? : data

Get or set single selection by Item.data

dataList Obj[] : dataList

Get or set multiple selection by Item.data

enabled Bool enabled(SelectMode mode)

Return if selection should be enabled for given select mode

id Obj? : id

Get or set single selection by Item.id

ids Ref[] : ids

Get or set multiple selection by Item.id

isEmpty Bool isEmpty()

Is the current selection empty

item Item? : item

Get or set single selection by Item

items Item[] : items

Get or set multiple selection by Item

max Int : max

Max entries to retain, or zero for unlimited. Overflow evicts the oldest.

mru Bool : mru

Most-recently-used ordering: add pushes to the front and re-adding an existing item refreshes its recency. Default appends to the end.

one Bool one()

Return if size is one

oneOrMore Bool oneOrMore()

Return if size is one or more

remove Void remove(Item item)

Remove item from the selection by id (no-op if not present)

size Int size()

Return number of selected items

toggle Void toggle(Item item)

Toggle item in the selection

Haxall 4.0.7 ∙ 27-Oct-2026 09:10 EDT