Solved

ComboBox ItemRenderer inside Datagrid

Posted on 2013-06-05
2
1,040 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

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Suggested Solutions

I made this because I wanted to get e-mail with a attached csv file so I'd would be able to import user input into a MS Excel template, but I also wanted to register/save all inputs from each day in a file on the server. 1st - It creates a temp C…
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
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 …
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

757 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now