Create an Editable List : List Renderer « Components « Flex






Create an Editable List

Create an Editable 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", foo:"a"}, 
                                        {name:"B", foo:"b"}, 
                                        {name:"C", foo:"c"}, 
                                        {name:"D", foo:"d"}]
        
        
                private function setEditor():void {
                    listImpl.editedItemPosition = {columnIndex:0, rowIndex:2};
                }
    
          
        </mx:Script>
        <mx:Button click="setEditor()"/>
        <mx:List y="30" 
                 width="200" 
                 selectedIndex="6" 
                 id="listImpl" 
                 selectionColor="#CCCCFF" 
                 labelField="name" 
                 dataProvider="{dp}" 
                 editable="true" 
                 itemEditBegin="trace(listImpl.editedItemPosition)" 
                 editorXOffset="5" 
                 editorYOffset="2"/>
    </mx:Canvas>
</mx:Application>
    

   
    
    
    
    
    
    
    
    
    
    
  








Related examples in the same category

1.DropIn RendererDropIn Renderer
2.Inline RendererInline Renderer
3.Inline Renderer with Complex ObjectsInline Renderer with Complex Objects
4.List control uses default item renderer to display stringsList control uses default item renderer to display strings
5.Renderer and Editor for ListRenderer and Editor for List
6.List control uses the default item renderer to display each of the three strings that represent postal codes for Alaska, Alabama, and Arkansas.List control uses the default item renderer to display each of the three strings that represent postal codes for Alaska, Alabama, and Arkansas.
7.Using Image renderer for ListUsing Image renderer for List
8.Specifying an icon to the List controlSpecifying an icon to the List control
9.Editable ListEditable List