ListItem (SUI)

An item in a list box, drop-down list, or tree view.

You can specify initial items in the creation parameters when creating the parent list. Create new items using the add() method (ListBox.add(), DropDownList.add(), TreeView.add()) in the parent list with control type="item", or, for DropDownList controls, type="separator".For a multi-column list box, the object represents one selectable row. Its text and image values specify the label in the first column, and the subitems property specifies the labels in the additional columns.

Objects:

Array, Boolean, Number, Object, ScriptUIImage (SUI), String

Property Listing

Property

Type

Access

Description

checked

Boolean

read/write

The checked state of an item in a list.

When true, the item is marked with the platform-appropriate checkmark. When false, no checkmark is drawn, but space is reserved for it in the left margin, so that the item lines up with other checkable items. When undefined, no space is reserved for a checkmark.

expanded

Boolean

read/write

The expansion state of an item of type node that is a child of a TreeView list control.

When true, the item is in the expanded state and its children are shown, when false, it is collapsed and children are hidden.

image

ScriptUIImage (SUI)

read/write

An image object for an icon to display in the item.

When specified, the image appropriate to the selections state is drawn to the left of the text label. If the parent is a multi-column list box, this describes the label in the first column. Labels in additional columns are described by the subitems property.

index

Number

readonly

The 0-based index of this item in the items collection of its parent list control.

parent

 

readonly

The parent element, a list control.

properties

Object

read/write

An object that contains one or more creation properties of the item (properties used only when the element is created).

A ListItem object has no creation properties.

selected

Boolean

read/write

The selection state of this item.

When true, the item is part of the selection for its parent list. When false, the item is not selected. Set to true to select this item in a single-selection list, or to add it to the selection array for a multi-selection list.

subItems

Array

readonly

When the parent is a multi-column ListBox, this describes the labels for this selectable row in additional columns.

A array of JavaScript objects whose length is one less than the number of columns. The first member describes the label in the second column. Each member object has two properties, of which you can specify one or both: text: A display string for the corresponding label. image: An ScriptUIImage object for the corresponding label.

text

String

read/write

The label text to display for the item, a localizable string.

If the parent is a multi-column list box, this describes the label in the first column. Labels in additional columns are described by the subitems property.

type

String

readonly

The element type.

Normally "item", but an item whose parent is a DropDownList control can have type "separator". A separator item is not mouse-sensitive and is drawn as a horizontal line across the drop-down or pop-up menu.

Object of

DropDownList (SUI).items

ListBox (SUI).items

TreeView (SUI).items

DropDownList (SUI).selection

TreeView (SUI).selection

ListBox (SUI).selection

Return

DropDownList (SUI).add()

ListBox (SUI).add()

TreeView (SUI).add()

DropDownList (SUI).find()

ListBox (SUI).find()

TreeView (SUI).find()