A button that exposes a list of choices and displays the chosen item.
Constructor
new (?parent:DisplayObjectContainer, ?xpos:Float, ?ypos:Float, ?defaultLabel:String, ?items:Array<ListItem>)
Constructor
Parameters:
parent | The parent DisplayObjectContainer on which to add this List. |
---|---|
xpos | The x position to place this component. |
ypos | The y position to place this component. |
defaultLabel | The label to show when no item is selected. |
items | An array of items to display in the list. Either strings or objects with label property. |
Variables
alternateRows:Bool
Sets / gets whether or not every other row will be colored with the alternate color.
autoHideScrollBar:Bool
Sets / gets whether the scrollbar will auto hide when there is nothing to scroll.
numVisibleItems:Int
Sets / gets the number of visible items in the drop down list. i.e. the height of the list.
Methods
addItem (item:Dynamic):Void
Adds an item to the list.
Parameters:
item | The item to add. Can be a string or an object containing a string property named label. |
---|
addItemAt (item:Dynamic, index:Int):Void
Adds an item to the list at the specified index.
Parameters:
item | The item to add. Can be a string or an object containing a string property named label. |
---|---|
index | The index at which to add the item. |
removeItem (item:Dynamic):Void
Removes the referenced item from the list.
Parameters:
item | The item to remove. If a string, must match the item containing that string. If an object, must be a reference to the exact same object. |
---|
removeItemAt (index:Int):Void
Removes the item from the list at the specified index
Parameters:
index | The index of the item to remove. |
---|
set_listItemClass (value:Class<ListItem>):Void
Sets / gets the class used to render list items. Must extend ListItem.