Mega Code Archive

 
Categories / Flex / Components
 

Using a label function to support a single-column List component

<?xml version="1.0"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"     backgroundColor="white">     <mx:Script>                  import mx.collections.ArrayCollection;         [Bindable]         public var myAC:ArrayCollection = new ArrayCollection([             {firstName:"A",lastName:"C"},             {firstName:"B",lastName:"D"}             ]);         public function fullName(rowItem:Object):String         {             return rowItem.firstName + ' ' + rowItem.lastName;         }            </mx:Script>     <mx:List dataProvider="{myAC}" labelFunction="fullName" /> </mx:Application>