<fx:Script>
<![CDATA[
...............
private var enterpriseInfoRO:RemoteObject=ServiceLocator.getInstance().getRemoteObject("enterpriseInfo_RO_ID") as RemoteObject;
private var reportRO:RemoteObject=ServiceLocator.getInstance().getRemoteObject("reportRO") as RemoteObject;
[Bindable]
private var enterprise_info:Array=[];
[Bindable]
public var inputEStr:String;
private var checkBox:CheckBox;
[Event(name="onDocumentLoadedError", type="flash.events.ErrorEvent")]
............
//加载企业信息
public function loadEnterpriseInfo():void
{
enterpriseInfoRO.getEnterprisesListByTID(cityInfo_CB_ID.selectedItem.value);
enterpriseInfoRO.addEventListener(ResultEvent.RESULT, enterpriseInfo_Handle);
}
public function enterpriseInfo_Handle(e:ResultEvent):void
{
enterpriseInfoRO.removeEventListener(ResultEvent.RESULT, enterpriseInfo_Handle);
if (e.result != null)
{
/**********返回列表*************/
var tempList:ArrayCollection=e.result as ArrayCollection;
var arr:Array=tempList.toArray();
enterprise_info=[];
for (var a in arr)
{
enterprise_info.push({label: arr[a][1], value: arr[a][0]});
}
enterpriseInfo_CB_ID.selectedIndex=0;
//flag=true;
loadReport();
}
}
//加载报表信息
public function loadReport():void
{
currentState='state1';
inputEStr=enterpriseInfo_CB_ID.text;
if (enterpriseInfo_CB_ID.selectedItem != null)
{
reportRO.getReportInfo(enterpriseInfo_CB_ID.selectedItem.value, time_ID.getTime_flag(), time_ID.getDate());
reportRO.addEventListener(ResultEvent.RESULT, reportInfo_Handle);
}
}
protected function search_keyUpHandler(event:KeyboardEvent):void
{
if(event.keyCode.toString()=='32'||event.keyCode.toString()=='13'||event.keyCode.toString()=='8'){
inputEStr=enterpriseInfo_CB_ID.text;
enterpriseInfoRO.getEnterprisesListByValue(cityInfo_CB_ID.selectedItem.value,StringUtil.trim(inputEStr));
enterpriseInfoRO.addEventListener(ResultEvent.RESULT,_result_enterprise_bySearch);
}
}
private function _result_enterprise_bySearch(e:ResultEvent):void{
enterpriseInfoRO.removeEventListener(ResultEvent.RESULT,_result_enterprise_bySearch);
if(e.result != null){
/**********返回列表*************/
var tempList: ArrayCollection = e.result as ArrayCollection;
var arr: Array = tempList.toArray();
var index:int=0;
enterprise_info=[];
for(var a in arr)
{
enterprise_info.push({label:arr[a][0],value:int(arr[a][1])});
index++
}
enterpriseInfo_CB_ID.text=inputEStr;
enterpriseInfo_CB_ID.open();
}
}
public function reportInfo_Handle(e:ResultEvent):void
{
reportRO.removeEventListener(ResultEvent.RESULT, reportInfo_Handle);
report_group_id.removeAllElements();
if (e.result != null)
{
/**********返回列表*************/
var tempList:ArrayCollection=e.result as ArrayCollection;
var arr:Array=tempList.toArray();
for (var a in arr)
{
var vGroup:VGroup=new VGroup();
var image:Image=new Image();
image.source=(String(arr[a][3]) == "0" ? "assets/png/report.png" : "assets/png/report2.png");
image.name=String(arr[a][2]);
image.useHandCursor="false";
image.buttonMode="true";
image.mouseChildren="false";
image.addEventListener(MouseEvent.CLICK, reportDetail);
vGroup.addElement(image);
var hGroup:HGroup=new HGroup();
var label:Label=new Label();
label.text="表" + arr[a][1];
var cb:CheckBox=new CheckBox();
cb.label="审核";
cb.selected=(String(arr[a][3]) == "0" ? false : true);
cb.id=String(arr[a][0])+"##"+String(arr[a][2]);
cb.addEventListener(Event.CHANGE,cb_change);
hGroup.addElement(label);
hGroup.addElement(cb);
vGroup.addElement(hGroup);
report_group_id.addElement(vGroup);
}
enterpriseInfo_CB_ID.text=inputEStr;
}
}
]]>
</fx:Script>
<s:BorderContainer width="100%"
..............
<mx:FormItem label="企业:"
indicatorGap="0">
<mx:ComboBox id="enterpriseInfo_CB_ID"
dataProvider="{enterprise_info}"
selectedIndex="0"
editable="true"
minWidth="100"
change="loadReport()"
keyUp="search_keyUpHandler(event)"
width="200"/>
</mx:FormItem>
..............
</s:BorderContainer>
分享到:
相关推荐
该实例展示了combobox通过输入进行过滤的数据源的方法,实现环境为flex4,测试通过,希望可以帮到你!
flex实现 ComboBox中下拉checkbox 经测试好用,还有可移动面板,和可改大小面板实例
C# ComboBox(winform 2008) 下拉多列 支持按输入的自动过滤(比如输入A,则以A开头的项全匹配出来),当只有一条满足条件时自动选中。
继承自C# Winform中...4、可在下拉列表中通过输入关键字,自动搜索符合条件的数据行。 5、可指定不同的值列和显示列。 6、可设置是否显示行头和列头。 7、程序根据显示列的多少和宽度,自动调整下拉界面的宽度。
flex中ComboBox嵌套checkbox的例子以及源代码。可以在下拉框中勾选一个或者多个可选项。
flex4中不能使用combobox,该类是用LIST 自写的一个代替类
3.可识别汉语拼音,字符及汉字。 4.精简算法,能够秒出内容。 5.带有注释。 6.可再渲染。 注:3个as文件放在同一目录或者包下,包引用记得自己改下。 在Flex 可视化编辑界面直接拖出就行。 有问题或者BUG 可联系QQ...
vs2008演示演示ComboBox下拉列表控件的使用实例
datagrid里添加combobox列,在拖动时会出现数据混乱问题,该实例解决此问题。
QTableView 中单元格添加控件的实例代码(含combobox)QTableView 中单元格添加控件的实例代码(含combobox)QTableView 中单元格添加控件的实例代码(含combobox)
一款非常实用的C#的combobox的第三方控件,可以实现,下拉后的列表中可以对列表进行勾选多条数据,能实现一些特殊的操作,希望对大家有用
自动 筛选 完成输入 combobox edit 网上下的。
flex ComboBox 包含一checkbox,可以下来测试看看,
组合框实例combobox
easyui中combobox后台交互实例
改变combobox的下拉高度
Flex 树形 ComboBox组件,Flex 树形 ComboBox组件,Flex 树形 ComboBox组件
ComboBox联想输入,可输入首字进行列表自动匹配并选中列表选项
ComboBox控件可以输入文本...该自定义控件利用visual studio2017开发,使用VB.NET语言对TextBox和ComboBox进行了改写,实现类百度搜索框似的输入文本智能模糊提示说明、自动匹配过滤功能。具体效果请参阅本人相关博文。
网上的一个silverlight的树形下拉控件,改成wpf使用的了,希望对各位有所帮助。