Adobe InDesign CS4 (6.0) Object Model JS: ListItem

InDesign CS4

Class

ListItem

 

A choice 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 in the parent list with control type="item", or, for DropDownList controls, type="separator".

Hierarchy

Object
ListItem

Properties

PropertyTypeAccessDescription
checkedbool r/wThe 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.
expandedbool r/wThe 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.
imageScriptUIImage r/wAn 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.
indexNumber readonlyThe 0-based index of this item in the items collection of its parent list control.
parentObject readonlyThe parent element, a list control.
propertiesObject r/wAn 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.
selectedbool r/wThe 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.
textString r/wThe label text to display for the item, a localizable string.
typeString readonlyThe 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.

Element of

DropDownList.items

DropDownList.selection

ListBox.items

ListBox.selection

TreeView.items

TreeView.selection

Return

ListItem DropDownList.add (type: String[, text: String])

ListItem DropDownList.find (text: String)

ListItem ListBox.add (type: String[, text: String])

ListItem ListBox.find (text: String)

ListItem TreeView.add (type: String[, text: String])

ListItem TreeView.find (text: String)

Jongware, 20-Jun-2010 v3.0.3dContents :: Index