Solved

ComboBox ItemRenderer inside Datagrid

Posted on 2013-06-05
2
1,096 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 29

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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

A short article about a problem I had getting the GPS LocationListener working.
This is about my first experience with programming Arduino.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

742 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