Set selected index for List : List Selection « Components « Flex






Set selected index for List

Set selected index for List
           

<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
    <mx:Canvas width="400" height="300">
        <mx:Script>
            
                [Bindable]
                private var dp:Array = [{name:"A", position:"a"}, 
                                        {name:"B", position:"b"}, 
                                        {name:"C", position:"c"},
                                        {name:"D", position:"d"}];
          
        </mx:Script>
        <mx:List width="200" 
                 selectedIndex="1" 
                 id="listImpl" 
                 selectionColor="#CCCCFF" 
                 labelField="name" 
                 dataProvider="{dp}" 
                 editable="true" />
    </mx:Canvas>
</mx:Application>

   
    
    
    
    
    
    
    
    
    
    
  








Related examples in the same category

1.Selected item and selected index from ListSelected item and selected index from List
2.Using binding to capture the selection of a List-based componentUsing binding to capture the selection of a List-based component
3.Set List selected itemSet List selected item
4.Set selection color for ListSet selection color for List
5.Spark List Selection change listenerSpark List Selection change listener
6.Enable multiple selection for the List controlEnable multiple selection for the List control