header
ask question
Click here to ask Question Now Its free No registration required. Flash, Flex, Flash Media Server, ActionScript,Adobe Air. Most questions receive a response in an hour.
john
Points:10
Posts:0

5/10/2010 9:00:36 AM

Title: having problems with advancedDataGrid


Having some trouble with the advanedDataGrid and the data returned by flashBuilder inspection.
I am presently trying to get advancedDataGrid to display data returned by a php service. We have used Flash Builder 4 php data service connection and data inspection to return the object array provided by a remote php method. The method has returned an array of objects including other arrays.
Flash Builder has created the value objects and shows the data returned in the Test Operations window - The structure of the data does not seem to appeal to the advancedDataGrid , which does not create Folders with nodes for the arrays .
I cant seem to find a way to arrange the advancedDataGrid display as folder and elements.
The data looks like this:

<p><a class="jive-link-external-small" href="http://cluttered.flvservers.com/dataImage.html">link to data structure</a></p
thank you



1
Rex
Points: 1280
Posts:0
5/10/2010 12:00:30 PM



check this sample xml with example the kind of structure that is required to populate the advancedDataGrid in flex.

<?xml version="1.0"?>
<!-- dpcontrols/adg/GroupADGChartRenderer.mxml -->
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" xmlns:local="*" creationComplete="onCreationComplete()">
	
	<mx:Script>
		<![CDATA[
			import mx.collections.ArrayCollection;
			
			[Bindable]
			public var dp:XML = new XML();
			
			public function onCreationComplete():void
			{
				dp=<list>
		<Fruits id="12" Fruits="Arizona" TotalFruits="2315320">
			<Territories>
				<Territory_Rep id="22" Territory_Rep="Tom"	Sold="38865" Estimate="40000"/>
				<Territory_Rep id="4" Territory_Rep="Mack"	Sold="29885" Estimate="30000"/>
			</Territories>
		</Fruits>
		<Fruits id="19" Fruits="California" TotalFruits="526345321">
			<Territories>
				<Territory_Rep id="6" Territory_Rep="Larry"	Sold="29134" Estimate="30000"/>
			</Territories>
		</Fruits>
		<Fruits id="8" Fruits="Nevada" TotalFruits="2315320">
			<Territories>
				<Territory_Rep id="10" Territory_Rep="Pitt"	Sold="52888" Estimate="45000"/>
			</Territories>
		</Fruits>
	</list>;
				
			}

			
			
		]]>
	</mx:Script>
	
	<mx:AdvancedDataGrid id="FruitsADG" 
						 width="100%" height="100%" 
						 variableRowHeight="true">
		<mx:dataProvider>    
			<mx:HierarchicalData source="{dp.Fruits}" childrenField="Territories"/>
		</mx:dataProvider>     
		<mx:columns>
			<local:CustomADGColumn dataField="@Fruits" headerText="Fruits" />
			<local:CustomADGColumn dataField="@TotalFruits" headerText="TotalFruits" />
			<local:CustomADGColumn dataField="@Sold" headerText="Sold" />
			<local:CustomADGColumn dataField="@Estimate" headerText="Estimate"/>
			
		</mx:columns>   
		
		
	</mx:AdvancedDataGrid>
</mx:Application>




2
john
Points: 10
Posts:0
5/10/2010 12:35:07 PM



Thanks for you reply Rex


Post your Reply
Name  

Email

Type your Reply or Answer

Are you human? What is 0+6 



Members Login

Email  
Password
Forgot Password





This website focus on: Flash | Flex | FMS | RED5 | WOWZA | Flash Media Server | Adobe AIR | ActionScript,Flash Solutions | Flash Question | Flash Answers | Flash Developers | Flash Problem, Flash Help, Flash bugs, Flash workaround | Flash Blog | Flex Question Answers | Flash Forum | Flex Development | Actionscript development | Flash development | Adobe AIR development
Copyright © 2008 AskMeFlash.com. All rights reserved. Privacy Policy | Terms & Conditions