<?xml version="1.0" encoding="utf-8"?> <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="200" minHeight="200"> <fx:Script> <![CDATA[ import mx.collections.ArrayCollection; import mx.events.FlexEvent; import spark.events.TextOperationEvent; [Bindable] public var complexDP:ArrayCollection = new ArrayCollection( [ {ingredient:"Salmon", category:"Meat"}, {ingredient:"Potato", category:"Starch"}, {ingredient:"Cucumber", category:"Vegetable"}, {ingredient:"Steak", category:"Meat"}, {ingredient:"Rice", category:"Starch"}, {ingredient:"Cumin", category:"Spice"} ] ); private function myLabelToItemFunction(input:String):* { return {ingredient:input, category:"mystery"}; } </fx:Script> <s:VGroup> <s:ComboBox id="cb" dataProvider="{complexDP}" width="150" labelToItemFunction="{myLabelToItemFunction}" selectedIndex="0" labelField="ingredient"/> </s:VGroup> </s:Application>
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)