Solved

ComboBox ItemRenderer inside Datagrid

Posted on 2013-06-05
2
1,073 Views
Last Modified: 2013-11-13
I have a DataGrid with a ComboBox as an ItemRenderer for one of my columns. When the user selects a row, I want to get the ComboBox's selected value for the selected row on clicking Submit.The datagrid has many columns and user has to select one value for each row.How to find out the selected value of the combo-box??


Here is my code:

<mx:DataGrid id="namesgrid" width="834" height="354" dataProvider="{List}"
                  resizableColumns="true" draggableColumns="true"
                  doubleClick="onGridClick()" doubleClickEnabled="true" x="0" y="0">
                  <mx:columns>
                        <mx:DataGridColumn id="bid" headerText="BName" dataField="branchdesc" width="100"/>
                        <mx:DataGridColumn id="poid" headerText="P-ID" dataField="proddesc" width="100"/>
                        <mx:DataGridColumn id="acid" headerText="No" dataField="accountno" width="80"/>
                        <mx:DataGridColumn id="nac" headerText="Name" dataField="mainpersonname" width="275"/>
                        <mx:DataGridColumn id="art" headerText="Type" dataField="recordtype" width="200"/>      
                <mx:DataGridColumn id="cmbtaskstatus" headerText="Status Change *" width="200"
                       editable="true" editorDataField="value">
                      <mx:itemRenderer>
                            <mx:Component>
                                  <mx:ComboBox color="#000000">
                                        <mx:dataProvider>
                                              <mx:String>FW</mx:String>
                                              <mx:String>AW</mx:String>
                                              <mx:String>CA</mx:String>
                                              <mx:String>OA</mx:String>
                                              <mx:String>RE</mx:String>                                              
                                        </mx:dataProvider>
                                  </mx:ComboBox>
                            </mx:Component>
                      </mx:itemRenderer>
                </mx:DataGridColumn>
   </mx:columns>
</mx:DataGrid>
0
Comment
Question by:CCBRONET
2 Comments
 
LVL 37

Accepted Solution

by:
zzynx earned 500 total points
ID: 39228241
No doubt this article can i nspire you: http://livedocs.adobe.com/flex/3/html/help.html?content=cellrenderer_6.html (See last example)
0
 
LVL 28

Expert Comment

by:Pravin Asar
ID: 39230943
You have to trap the click or change event for the  itemrenderer (combobox)

change="Alert('You selected ' + data.selected); trace(data.selected);"
0

Featured Post

Active Directory Webinar

We all know we need to protect and secure our privileges, but where to start? Join Experts Exchange and ManageEngine on Tuesday, April 11, 2017 10:00 AM PDT to learn how to track and secure privileged users in Active Directory.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Entering a date in Microsoft Access can be tricky. A typo can cause month and day to be shuffled, entering the day only causes an error, as does entering, say, day 31 in June. This article shows how an inputmask supported by code can help the user a…
Computer science students often experience many of the same frustrations when going through their engineering courses. This article presents seven tips I found useful when completing a bachelors and masters degree in computing which I believe may he…
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question