读书人

Flex中禁用Combobox的可编者属性和添加

发布时间: 2012-10-13 11:38:17 作者: rapoo

Flex中禁用Combobox的可编辑属性和添加prompt属性

Flex中禁用Combobox的可编辑属性和添加prompt属性

Flex中可以选择使用Dropdownlist或者Combobox来实现一些下拉列表的功能,通过本实例,Dropdownlist和Combobox基本上实现了同等功能转换

Combobox禁用了inputtext的可编辑属性。闲言碎语不要讲,我有代码来呈上!

<?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" viewSourceURL="srcview/index.html">     <fx:Script>        <![CDATA[            import mx.collections.ArrayCollection;            import mx.events.FlexEvent;             import spark.events.DropDownEvent;             private var arr:Array=[{label:"Red"},{label:"Orange"},{label:"Yellow"},{label:"Blue"},{label:"Green"}];            [Bindable]            private var myData:ArrayCollection=new ArrayCollection(arr);             protected function combobox1_creationCompleteHandler(event:FlexEvent):void            {                this.cb.textInput.text="Please Select";            }             protected function cb_closeHandler(event:DropDownEvent):void            {                this.cb.setStyle("skinClass",undefined);            }         ]]>    </fx:Script>    <s:layout>        <s:VerticalLayout verticalAlign="middle" horizontalAlign="center"/>    </s:layout>    <s:ComboBox id="cb" skindataProvider="{myData}"                creationComplete="combobox1_creationCompleteHandler(event)" close="cb_closeHandler(event)"/> </s:Application>
?

?

1 楼 omooeo 2011-12-15 我用你上面的代码试了一下, 还是可以输入。 2 楼 guangqiang 2011-12-16 omooeo 写道我用你上面的代码试了一下, 还是可以输入。
不会吧 那你用dropdownlist吧

读书人网 >flex

热点推荐