Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
i have a datagrid which is getting values from a XML file (getting this xml file from database using PHP and HTTP request in flex). i have created a checkbox in every row in data grid. and here is my requirement: i want to select tow or three check-box and would like to get all the values form that particular ROWs in some form , prefered arraycollection (such that i can pass this array directly to a bar chart) .. can some one help me as i am new to flex .
code .....
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" creationComplete="siteData.send()">
	<mx:Script>
		<![CDATA[
			import mx.collections.XMLListCollection;
			import mx.controls.*;
			import mx.events.ListEvent;
			import mx.rpc.events.ResultEvent;
			import mx.controls.Alert;
			[Bindable] private var fullXML:XMLList; 
			private function contentHandler(evt:ResultEvent):void{
				fullXML = evt.result.values;
			}
		
		
	</mx:Script>
	<mx:VBox>
		<mx:Label text="This Data Grid is loading the full XML file"/>
		<mx:DataGrid width="600"  id="datagrid" dataProvider="{fullXML}">
			
			<mx:columns>
				<mx:DataGridColumn headerText="Select">
					<mx:itemRenderer>
						<mx:Component>
							<mx:HBox horizontalAlign="center">
 
								<mx:CheckBox id="check"/>
							</mx:HBox>
						</mx:Component>
					</mx:itemRenderer>
				</mx:DataGridColumn>
				<mx:DataGridColumn dataField="release_version" headerText="Release"/>
				<mx:DataGridColumn dataField="build" headerText="build"/>
				<mx:DataGridColumn dataField="time_login" headerText="time_login"/>
				<mx:DataGridColumn dataField="time_tunnel" headerText="time_tunnel"/>
				<mx:DataGridColumn dataField="rate_login" headerText="time_tunnel"/>
				<mx:DataGridColumn dataField="rate_tunnel" headerText="rate_tunnel"/>
			</mx:columns>
		</mx:DataGrid>
	</mx:VBox>
	<mx:HTTPService url="http://localhost/php_genxml.php" id="siteData" result="contentHandler(event)" resultFormat="e4x"/>
</mx:Application>
 
I want to select some check box and want to get the values of all the fields in data-grid correspond to that check-box, can some one help me how to get the selected values (selected values of check-box) in flex and action script.
Posted 2-Jan-12 8:42am
tanujm492
Edited 2-Jan-12 8:50am
v3

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 195
1 ProgramFOX 130
2 Maciej Los 105
3 Afzaal Ahmad Zeeshan 82
4 Sergey Alexandrovich Kryukov 75
0 OriginalGriff 6,564
1 Sergey Alexandrovich Kryukov 6,048
2 DamithSL 5,228
3 Manas Bhardwaj 4,717
4 Maciej Los 4,150


Advertise | Privacy | Mobile
Web04 | 2.8.1411022.1 | Last Updated 2 Jan 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100