Classes
AddedRemovedEvent
AlertElement
AnchorContainerElement
ArrowShape
ButtonElement
CanvasElement
CanvasManager
CheckboxElement
CheckboxSkinElement
CollectionChangedEvent
CollectionSort
ColorPickerButtonElement
ColorPickerElement
ContainerBaseElement
CursorDefinition
DataGridColumnDefinition
DataGridDataRenderer
DataGridElement
DataGridHeaderColumnDividerSkinElement
DataGridHeaderElement
DataGridHeaderItemRenderer
DataGridItemData
DataGridItemRendererBase
DataGridLabelItemRenderer
DataListData
DataListElement
DataRendererBaseElement
DataRendererLabelElement
DatePickerButtonElement
DatePickerElement
DispatcherEvent
DrawMetrics
DropdownArrowButtonSkinElement
DropdownBaseElement
DropdownElement
ElementEvent
ElementGridItemClickEvent
ElementKeyboardEvent
ElementListItemClickEvent
ElementMouseEvent
ElementMouseWheelEvent
EllipseShape
EventDispatcher
FillBase
GridContainerElement
GridContainerRowColumnDefinition
ImageElement
IpInputElement
LabelElement
LinearGradientFill
ListCollection
ListContainerElement
ProgressElement
RadioButtonElement
RadioButtonSkinElement
RoundedRectangleShape
ScrollBarElement
ScrollButtonSkinElement
ShapeBase
SkinnableElement
SolidFill
StyleableBase
StyleChangedEvent
StyleData
StyleDefinition
StyleProxy
TextAreaElement
TextElement
TextFieldElement
TextInputElement
TimeInputElement
ToggleButtonElement
ToggleButtonGroup
Tween
ViewportElement


DataListElement

DataListElement is a data-driven container that renders items in a
horizontal or vertical orientation via a supplied ListCollection and a supplied DataRenderer class.
A DataRenderer is any CanvasElement that implements _setListData() and _setListSelected()
and is used to render the corresponding ListCollection item. A scroll bar will be added
if the collection size exceeds the available area. DataListElement only renders visible
DataRenderers so collection size does not impact performance.
DataRendereBaseElement is an abstract base class that implements common
features and can be sub-classed if desired.
The default DataRenderer is the DataRendererLabelElement which renders
a text label per the LabelFunction style.

Inheritance:     DataListElement ➞ CanvasElementStyleableBaseStyleDefinitionEventDispatcher ➞ Object

Styles
Show Inherited
Style Defined By
ItemLabelFunction     :    Function DataListElement
A function that returns a text string per a supplied collection item.
function (itemData) { return "" }
 
LayoutDirection     :    String DataListElement
Determines the layout direction of this DataList. Allowable values are "horizontal" or "vertical".
 
LayoutGap     :    Number DataListElement
Space in pixels to leave between child elements.
(Not yet implemented)
 
LayoutHorizontalAlign     :    String DataListElement
Child horizontal alignment to be used when children do not fill all available space. Allowable values are "left", "right", or "center".
(Only partially implemented, depending on LayoutDirection)
 
LayoutVerticalAlign     :    String DataListElement
Child vertical alignment to be used when children do not fill all available space. Allowable values are "top", "bottom", or "middle".
(Only partially implemented, depending on LayoutDirection)
 
ListItemClass     :    CanvasElement DataListElement
The CanvasElement constructor to be used for the DataRenderer.
 
ListItemStyle     :    StyleDefinition DataListElement
The StyleDefinition or [StyleDefinition] array to be applied to the DataRenderer.
 
ScrollBarDisplay     :    String DataListElement
Determines the behavior of the scroll bar. Allowable values are "on", "off", and "auto".
 
ScrollBarPlacement     :    String DataListElement
Determines the placement of the scroll bar.
Allowable values are "top" or "bottom" for horizontal layout and "left" or "right" for vertical layout.
 
ScrollBarStyle     :    StyleDefinition DataListElement
The StyleDefinition or [StyleDefinition] array to be applied to the scroll bar.
 
Selectable     :    boolean DataListElement
When true, list items can be selected and the DataList will dispatch "changed" events.
 


Events
Show Inherited
Event Defined By
changed     :    ElementEvent DataListElement
Dispatched when the selected item/index changes as a result of user interaction.
 
listitemclick     :    ElementListItemClickEvent DataListElement
Dispatched when a DataRenderer is clicked. Includes associated collection item/index.
 


Public Functions
Show Inherited
Function Defined By
DataListElement() [Constructor] DataListElement
Creates new DataListElement instance.
 
DefaultItemLabelFunction(itemData) [Static] DataListElement
Default ItemLabelFunction function. Looks for typeof String or "label" property of supplied itemData.
  itemData     :    Object
Collection item to extract label text.
  returns     :    String
Label text.
 
getListCollection() DataListElement
Gets the DataLists's associated ListCollection.
  returns     :    ListCollection
The associated ListCollection or null if none assigned.
 
getSelectedIndex() DataListElement
Gets the selected collection index.
  returns     :    int
The selected collection index or -1 if none selected.
 
getSelectedItem() DataListElement
Gets the selected collection item.
  returns     :    Object
The selected collection item or null if none selected.
 
setListCollection(listCollection) DataListElement
Sets the DataLists's associated ListCollection to generate DataRenderers.
  listCollection     :    ListCollection
The ListCollection to be used as the data-provider.
 
setScrollIndex(scrollIndex) DataListElement
Sets the collection item index to scroll too.
  scrollIndex     :    int
Collection item index.
 
setSelectedIndex(index) DataListElement
Sets the selected collection index/item.
  index     :    int
The collection index to be selected.
  returns     :    bool
Returns true if the selection changed.
 
setSelectedItem(item) DataListElement
Sets the selected collection item/index.
  item     :    Object
The collection item to be selected.
 


Internal Members
Show Inherited


Internal Functions
Show Inherited
Function Defined By
_createRenderer(itemIndex) DataListElement
Generates a DataRenderer based on the ListItemClass style.
  itemIndex     :    int
Collection index associated with the DataRenderer.
  returns     :    CanvasElement
The new DataRenderer instance.
 
_getContentSize() DataListElement
Gets the content size of the DataList. This is only accurate after the DataList
has finished its layout phase. Currently only used by the Dropdown to fix the
vertical height of the drop down pop-up list when there are too few items.
  returns     :    Number
Content size in pixels of the DataListElement. Only valid after layout phase completed.
 
_getNumRenderers() DataListElement
Gets the number of DataRenderers that are currently being rendered.
  returns     :    int
the number of DataRenderers that are currently being rendered.
 
_invalidateListRenderersLayout() DataListElement
Calls _invalidateLayout() on all DataRenderers.
 
_invalidateListRenderersMeasure() DataListElement
Calls _invalidateMeasure() on all DataRenderers.
 
_onDataListCollectionChanged(collectionChangedEvent) DataListElement
Event handler for the ListCollection "collectionchanged" event. Updates DataRenderers.
  collectionChangedEvent     :    CollectionChangedEvent
The CollectionChangedEvent to process.
 
_onDataListMouseWheelEvent(elementMouseWheelEvent) DataListElement
Event handler for the DataList "wheel" event. Starts the scroll bar tween.
  elementMouseWheelEvent     :    ElementMouseWheelEvent
The ElementMouseWheelEvent to process.
 
_onDataListRendererClick(elementMouseEvent) DataListElement
Event handler for the DataRenderer "click" event. Updates selected index/item and dispatches "listitemclick" and "changed" events.
  elementMouseEvent     :    ElementMouseEvent
The ElementMouseEvent to process.
 
_onDataListScrollBarChanged(elementEvent) DataListElement
Event handler for the scroll bar "changed" event. Updates DataRenderers.
  elementEvent     :    ElementEvent
The ElementEvent to process.
 
_resetRenderersListData() DataListElement
Updates list data on all renderers, such as when collection is changed.
 
_updateRendererData(renderer, itemIndex) DataListElement
Updates the DataRenderer list data and selected state.
  renderer     :    CanvasElement
DataRenderer to update.
  itemIndex     :    int
Collection index to associate with the DataRenderer.