Set label field for data source of List control : List Label « Components « Flex






Set label field for data source of List control

Set label field for data source of List control
           
<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.Using labelField to tell List which column to presentUsing labelField to tell List which column to present
2.Combine label and data for List itemCombine label and data for List item
3.Using a label function with one-column List-based componentsUsing a label function with one-column List-based components
4.Using a label function to support a single-column List componentUsing a label function to support a single-column List component
5.Get selected item label from a listGet selected item label from a list
6.Drag and drop label value to a ListDrag and drop label value to a List
7.Format List with labelFunction propertyFormat List with labelFunction property
8.Using a function to combine the values of the label and data fields for each item for display in the List controlUsing a function to combine the values of the label and data fields for each item for display in the List control
9.Use a label function to concatenate the firstName and lastName fields of each data item for display by the controlUse a label function to concatenate the firstName and lastName fields of each data item for display by the control