Flex组件 自动提示输入框

[url]http://labs.eshangrao.com/flex/2/plum/Plum/docs/com/eshangrao/controls/AutoQueryTextInput.html[/url]
首先要说的是这个AutoQueryTextInput组件,做Web开发的应该都有用过这也的组件,就是在用户边输入内容,自动根据用户数据从后台取回数据,并显示一个下拉列表提示用户,以自动补齐或动态查询。这个AutoQueryTextInput组件实现这一功能的Flex实现。另外考虑到后台获取数据的方式的诧异性,实际的后台数据获取是由用户自己实现(监听query事件并向后台获取数据),然后在数据获取到后,将获取的数据赋值给AutoQueryTextInput.serviceData。下面是一个示例:

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
xmlns:eshangrao="http://www.eshangrao.com">
<mx:Script>
<![CDATA[
import mx.collections.ArrayCollection;
private function doQuery():void{
var data:ArrayCollection=new ArrayCollection();
for(var i:int;i<6;i++){
var obj:Object=new Object();
obj.ID=i;
obj.label=aqti.text+"index:"+i;
data.addItem(obj);
}
aqti.serviceData=data;//获取到数据后,显示提示列表
}
private function serviceDataShowFunction(item:Object):String{
return item.ID+"-"+item.label;
}
]]>
</mx:Script>
<mx:Form>
<mx:FormItem label="test:">
<eshangrao:AutoQueryTextInput id="aqti" query="doQuery()" serviceDataShowType="{AutoQueryTextInput.SHOW_CUSTOM}" serviceDataShowFunction="{serviceDataShowFunction}"/>
</mx:FormItem>
</mx:Form>
</mx:Application>


SystemFontsRichTextEditor:
SystemFontsRichTextEditor组件的功能很简单,就是一个会自动读取您的系统当前可用字体列表并添加到字体选择框的RichTextEditor:
[url]http://livedocs.adobe.com/flex/3/langref/mx/controls/RichTextEditor.html[/url]
[url]http://labs.eshangrao.com/flex/2/plum/Plum/docs/com/eshangrao/controls/SystemFontsRichTextEditor.html[/url]

文章来自: 闪无忧(www.5uflash.com) 详文参考:http://www.5uflash.com/Flex-AIR/Flexziliao/4442.html
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值