针对FLEX3中ComboBox的用法,在FLEX4中用法有区别需将s改为mx:
<s:DropDownList dataProvider="{provider}" labelField="label"/>
或
<mx:ComboBox dataProvider="{provider}" labelField="label"/>
另外需要注意的两点有:
1)DropDownList的DataProvider不能是Array类型的
2)DropDownList默认显示时与ComboBox不一样,需要手动指定 selectedIndex的值
下面给出一段示例:
<?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="955" minHeight="600" creationComplete="init()">
<fx:Declarations>
<!-- Place non-visual elements (e.g., services, value objects) here -->
<fx:Array id="arr">
<fx:Object dataField="宋体" headerText="宋体"/>
<fx:Object dataField="楷体" headerText="楷体"/>
<fx:Object dataField="黑体" headerText="黑体"/>
</fx:Array>
<s:ArrayList id="arr1">
<fx:Object dataField="宋体" headerText="宋体"/>
<fx:Object dataField="楷体" headerText="楷体"/>
<fx:Object dataField="黑体" headerText="黑体"/>
</s:ArrayList>
</fx:Declarations>
<s:Panel x="448" y="159" width="250" height="200">
<mx:ComboBox x="73" y="10" dataProvider="{arr}" labelField="headerText" selectedIndex="0"/>
<s:DropDownList x="73" y="50" dataProvider="{arr1}" labelField="headerText" selectedIndex="0"/>
</s:Panel>
</s:Application>
分享到:
相关推荐
NULL 博文链接:https://bigt.iteye.com/blog/1124187
C# 控件 DropDownList控件和comboBox控件自动生成年月日 方便易用,对初学者,老程序员都有很大的帮助。
DropDownList与TextBox互动
DropDownList
从其他网站找的一个Flex 下拉多选 支持ComboBox DropDownList 带有复选框
ASP .NET MVC4 @Html.DropDownList后台绑定数据展示到页面下拉框中
dropdownlist下拉框实现多选
C#编程 WinForm窗体开发 DropDownList(源码)C#编程 WinForm窗体开发 DropDownList(源码)C#编程 WinForm窗体开发 DropDownList(源码)C#编程 WinForm窗体开发 DropDownList(源码)C#编程 WinForm窗体开发 DropDownList...
解决dropdownlist数据绑定后选择下拉列表后返回的值不变或为空的问题!!我就是这样解决的。本来运行好好的,后来突然不行了。。。抓耳挠腮,终于发现原来是这个原因。
flex Datagrid checkbox全选 Datagrid
调用方法:DropDownList.bind(selectId).例如: --------------------------------- DropDownList2: <option selected="selected" value="35">gdfgfdgjjjjjjjjjjjj └All Categories ...
用jquery 操作 dropdownList,实现4个dropdownlist的级联刷新与获取数据
_dropdownlist和js日期运用
DropDownList分组扩展DropDownList分组扩展DropDownList分组扩展DropDownList分组扩展
jquery异步绑定dropdownlist
gridview与dropdownlist组合,用的挺好,在gridview中实现数据交互.
DropDownList 3级联动,非常实用
C# DropDownList与CheckBox 操作例子.rar
三层结构 DropDownList无极分类 用泛型 DropDownList无极分类 用泛型 DropDownList无极分类 用泛型 DropDownList无极分类 用泛型
级联菜单DropDownList 级联菜单DropDownList 级联菜单DropDownList 级联菜单DropDownList 级联菜单DropDownList 级联菜单DropDownList 级联菜单DropDownList