PAIP.自定义SELECT BOX COMMBO BOX展现.txt

1.加入dropdown.mxml

2.主MXML中,加入以下代码<sys:dropdown ;120" fontSize="12" id="txt_customer_name" change="changeclear_customer(event)" open="openclic_customer

()"/>

private var customerChoose:dropdown_customer_public = new dropdown_customer_public();private function openclic_customer():void{customerChoose.refresh();}private function showpopupTitleWindow_customer():void{customerChoose.customer_id_obj = txt_customer_id;customerChoose.customer_name_obj = txt_customer_name;txt_customer_name.popUp = customerChoose;}

3.dropdown_customer_public.mxml (GRID页面)

public var customer_id_obj:Object;public var customer_name_obj:Object;public function initApp():void{query();}private function showSelectitem(oEvent:Event):void{customer_id_obj.text=dgd.selectedItem.gf_company_code;customer_name_obj.text=dgd.selectedItem.cust_name;customer_name_obj.close();}

private function query():void{customersBO.queryCustomerList({keyword:txtKeyword.text});}public function refresh():void{if(initialized){if(dgd.dataProvider!=null && dgd.dataProvider.length)customersBO.queryCustomerList.lastResult.clearResult();txtKeyword.text="";query();dgd.selectedIndex = -1;}}]]><mx:DataGrid id="dgd" x="2" y="27" ;293" height="160" dataProvider="{customersBO.queryCustomerList.lastResult}"

change="showSelectitem(event)"><mx:TextInput id="txtKeyword" x="25" y="2" ;197" height="22" paddingBottom="0" paddingTop="0" textAlign="left"

borderStyle="solid"/><mx:Button id="btnQuery" x="250" y="2" label="筛选" ;34" height="22" paddingLeft="1" paddingRight="1"

cornerRadius="4" fillColors="[0xFFFFFF, 0x6E8DC4, 0xFFFFFF, 0xEEEEEE]" fontWeight="normal" fillAlphas="[0.6, 0.8, 0.6, 0.6]"

click="query()"/>

Powered by Zoundry