Click here to Skip to main content
15,885,689 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
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
<?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
Updated 2-Jan-12 7:50am
v3

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900