[Flex4] Use combox in the DataGrid

Source: Internet
Author: User

I wrote a little complicated. I found examples on the Internet. They looked simple, but the environment was different. They were implemented only after the change. This is the simplest one I have changed. The data sources of DataGrid and comboxr are both background databases.

<! -- // Defines the drop-down selection embedded in the DataGrid item /////////////////////////////////////// /// --> <FX: component id = "cbb_datatype"> <s: mxdatagriditemrenderer focusenabled = "true"> <FX: SCRIPT> <! [CDATA [import MX. Collections. arraylist; Public Function get rating (): String {If (CBB. selecteditem! = NULL) return CBB. selecteditem. label. tostring (); Return CBB. textinput. text;} public function selectedstr (): void {CBB. dataprovider = outerdocument. statdatatparr_comb; CBB. textinput. TEXT = outerdocument. datagrid_statresult.selecteditem.tbflddatatypename; CBB. textinput. editable = false;}]> </FX: SCRIPT> <s: ComboBox id = "CBB" width = "100%" initialize = "selectedstr () "/> </S: mxdatagriditemrenderer> </FX: component>

 

<Mx: columns> <mx: datagridcolumn headertext = "result type no." datafield = "statrestypenum"/> <mx: datagridcolumn headertext = "result type name" datafield = "statrestypename"/> <mx: datagridcolumn headertext = "type" datafield = "tbflddatatypename" editordatafield = "rating" itemeditor = "{This. cbb_datatype} "> </MX: datagridcolumn> <mx: datagridcolumn headertext =" length "datafield =" statrestypedatatypewidth "/> <mx: datagridcolumn headertext = "header type" datafield = "statresbandtype"/> </MX: columns>

 

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.