Differences between ComboBox and DropDownList
1)First difference between the controls is that the prompt area of the ComboBox control is implemented by using the TextInput control, instead of the Label control for the DropDownList control.
2) a user can edit the prompt area of the ComboBox control to enter a value that is not one of the predefined options; the values in the DropDownList cannot be edited.
3) However, because dataProvider is the DropDownList control’s default property, you do not have to specify a child tag of the tag, as the following example shows:
Code:
1)First difference between the controls is that the prompt area of the ComboBox control is implemented by using the TextInput control, instead of the Label control for the DropDownList control.
2) a user can edit the prompt area of the ComboBox control to enter a value that is not one of the predefined options; the values in the DropDownList cannot be edited.
3) However, because dataProvider is the DropDownList control’s default property, you do not have to specify a
Code:
<s:application backgroundcolor="#528CDA" minheight="600" minwidth="955" xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:mx="library://ns.adobe.com/flex/mx" xmlns:s="library://ns.adobe.com/flex/spark">
<s:layout>
<s:verticallayout paddingleft="5" paddingtop="5">
</s:verticallayout></s:layout>
<fx:declarations>
</fx:declarations>
<s:label text="Spark ComboBox ">
<s:combobox id="mySparkCB" prompt="Select a Color" width="140">
<s:dataprovider>
<mx:arraylist>
<fx:string>Pink</fx:string>
<fx:string>Orange</fx:string>
<fx:string>Yellow</fx:string>
<fx:string>Red</fx:string>
<fx:string>Blue</fx:string>
<fx:string>Green</fx:string>
</mx:arraylist>
</s:dataprovider>
</s:combobox>
<s:label text="Spark DropDownList ">
<s:dropdownlist width="160">
<mx:arraycollection>
<fx:string>Atlanta</fx:string>
<fx:string>SpringFiled</fx:string>
<fx:string>Chicago</fx:string>
<fx:string>New York</fx:string>
<fx:string>California</fx:string>
</mx:arraycollection>
</s:dropdownlist>
</s:label></s:label></s:application>
Hi
ReplyDeleteMy requirement is when I open drop down list it displays check boxes, based on check box selection I need to display values in data grid.
Could you please tell me the basic idea to insert check boxes in drop down list
Thanks in advance
You have to use itemRenderer for dropdownList
ReplyDelete