You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

Set the data provider

Create the data provider in MXML:

<js:List labelField="label">
    <js:dataProvider>
<fx:Array>
            <fx:Object label="One"/>
            <fx:Object label="Two"/>
            <fx:Object label="Three"/>
            <fx:Object label="Four"/>
            <fx:Object label="Five"/>
        </fx:Array>
    </js:dataProvider>
</js:List>

The labelField specifies which property of the items will be displayed as text in the list's item renderers.

Listen to events

Listen for selection changes:

<js:List change="onChange()">
  • No labels