Adobe Dreamweaver Forums



Last 10 THreads :         Conditional loop (Last Post : Dan Bracuk - Replies : 4 - Views : 5 )           »          How to turn IMAGE into MOVIECLIP??? (Last Post : Snufferson - Replies : 0 - Views : 1 )           »          Please point me to the correct topic section of thisForum (Last Post : GillyWilly - Replies : 8 - Views : 9 )           »          DIV in Table not working. (Last Post : adambaum - Replies : 0 - Views : 1 )           »          pop up blocker jacking my login (Last Post : reelhero - Replies : 2 - Views : 3 )           »          SWF slide show does not play (Last Post : Mad Dog - Replies : 3 - Views : 4 )           »          Flash-PHP Mail Form (Last Post : richmaxw - Replies : 0 - Views : 1 )           »          Flex compiler in FlexBuilder and Flex SDK (Last Post : 2009 Matt - Replies : 0 - Views : 1 )           »          Basing new project on old project (Last Post : Stephen Windham - Replies : 2 - Views : 3 )           »          Performing a search within multiple .as files (Last Post : JohnnyDang - Replies : 0 - Views : 1 )           »         


Home Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
User Info Statistics
Go Back   Adobe Dreamweaver Forums > Other Macromedia/Adobe Products > Flex
 
Tags:



Reply
  #1 (permalink)  
Old 10-03-2008, 11:12 AM
SMannava
 
Posts: n/a
Diggs:
Default Advanced Datagrid multi level rendering

Hi,

I am very new to Advanced datagrid and can't able to figure out how to render
a collection I am getting.
The data is look like the Hirarchy bellow.

----games:ListCollectionView
------------ gameTurns: ListCollectionView
---------------------gameOrders:ListCollectionView

What I am trying here is displaying them in Hirarchy.

The resultHandler i have is like this.

private function getGameHistoryResultHandler(e:ResultEvent):void
{
//Alert.show("getGameHistoryResultHandler (expected GameHistoryDto) : " +
e.result);
if (! e.result is GameHistoryDto)
{
Alert.show("Invalid result (expected GameHistoryDto) : " + e.result);
return;
}

// extract game history
var gameHistoryDto:GameHistoryDto = e.result as GameHistoryDto;

/**
gameHistoryData = new HierarchicalData(gameHistoryDto.games);


gameHistoryData.childrenField = "gameTurns";


gameHistoryADG.dataProvider = gameHistoryData;
*/
//////////////////////////////////

var g:Grouping = new Grouping();
g.fields = [new GroupingField("name")];

var gc:GroupingCollection = new GroupingCollection();
gc.source = gameHistoryDto.games;//new ArrayCollection(planets);
//gc.grouping = g;
//
gc.childrenField = "gameTurns";

//gc.childrenField = "gameOrders";
////gc.childrenField = "gameBids";
//gc.childrenField = "gamePrizes";
gc.refresh();


gameHistoryADG.dataProvider = gc;
//gameHistory.dataProvider = e.result;


}

//////////////////////////////////////////////
The MXML is

<mx:AdvancedDataGrid id="gameHistoryADG" dataProvider="{new
HierarchicalData(gameHistoryData)}"
variableRowHeight="true" width="700" height="500">
<mx:columns>
<mx:AdvancedDataGridColumn dataField="name" headerText="Name" width="250"/>
<mx:AdvancedDataGridColumn dataField="duration" headerText="Duration" />
<mx:AdvancedDataGridColumn dataField="requiredPlayers" headerText="Required
Players" />
<mx:AdvancedDataGridColumn dataField="entranceFee" headerText="Entrance
Fee" />
</mx:columns>

<mx:rendererProviders>
<mx:AdvancedDataGridRendererProvider depth="2" columnIndex="1"
columnSpan="0">
<mx:renderer>
<mx:Component>

<mx:AdvancedDataGrid variableRowHeight="true">

<mx:Script>

<![CDATA[


override public function set data(value:Object):void
{

dataProvider = value;

}
]]>
</mx:Script>

<mx:columns>
<mx:AdvancedDataGridColumn dataField="name" headerText="Name" />
<mx:AdvancedDataGridColumn dataField="playerName" headerText="Player
Name" />
<!--
<mx:AdvancedDataGridColumn dataField="gameType" headerText="Game
Type"/>
<mx:AdvancedDataGridColumn dataField="gameStatus" headerText="Game
Status"/>
<mx:AdvancedDataGridColumn dataField="turnState" headerText="Turn
State"/>
-->
</mx:columns>

<mx:rendererProviders>

<mx:AdvancedDataGridRendererProvider depth="3" columnIndex="2"
columnSpan="0">
<mx:renderer>
<mx:Component>

<mx:AdvancedDataGrid xmlns="*"
xmlns:mx="http://www.adobe.com/2006/mxml">
<mx:Script>
<![CDATA[
import mx.collections.GroupingCollection;

public var gc:GroupingCollection = new GroupingCollection();

override public function set data(value:Object):void
{
gc.source = value['gameOrders'];
gc.refresh();
dataProvider = gc;

}
]]>
</mx:Script>

<mx:columns>
<mx:AdvancedDataGridColumn dataField="name"
headerText="Name" />
<mx:AdvancedDataGridColumn dataField="tradeableID"
headerText="Tradable ID" />
<mx:AdvancedDataGridColumn dataField="volume"
headerText="Volume" />
<mx:AdvancedDataGridColumn dataField="priceOrdered"
headerText="Order Price"/>
<mx:AdvancedDataGridColumn dataField="priceExecuted"
headerText="Executed Price"/>
</mx:columns>

</mx:AdvancedDataGrid>

</mx:Component>
</mx:renderer>
</mx:AdvancedDataGridRendererProvider>


</mx:rendererProviders>

</mx:AdvancedDataGrid>

</mx:Component>
</mx:renderer>
</mx:AdvancedDataGridRendererProvider>

</mx:rendererProviders>




</mx:AdvancedDataGrid>

A quick help will be appriciated.,

Thanks,
Srinivas



Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 10-03-2008, 12:12 PM
SMannava
 
Posts: n/a
Diggs:
Default Re: Advanced Datagrid multi level rendering

Hi Can any one help on this
Reply With Quote
  #3 (permalink)  
Old 10-03-2008, 02:51 PM
Amy Blankenship
 
Posts: n/a
Diggs:
Default Re: Advanced Datagrid multi level rendering


"SMannava" <webforumsuser@macromedia.com> wrote in message
news:gc4uah$8c6$1@forums.macromedia.com...
> Hi Can any one help on this


Could you be more specific on how what you're getting is different from what
you want?


Reply With Quote


  #4 (permalink)  
Old 10-03-2008, 04:41 PM
SMannava
 
Posts: n/a
Diggs:
Default Re: Advanced Datagrid multi level rendering

Hi Amy,

From the server I am getting a gameDTO

GameHistoryDTO {

gamesList <GameDTO>

}
GameDTO{
gameTurnsList<GameTurnDTO>
.....other game related attributes
}
GameTurnDTO{
gameOrdersList<GameOrderDTO>
gameBidsList<GameBidDTO>
gamePrizesList<GamePrizeDTO>
--- other game turn attributes
}

Now I want to display this collection in Advanced data grid as

--Games<GameDTO>
------------GameTurns<GameTurnDTO>
--------------------GameOrders<GameOrderDTO>
--------------------GameBids<GameBidDTO>
--------------------GamePrizes<GamePrizeDTO>

In simple terms games has game turns and gameturns has gameorders, gamebids
and gameprizes.

Please let me know if you need any further details



Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



© Camley Interactive (camley.info) 2008 - all logos and images are copywrite their respective owners.
Proud member of the Camley Interactive Network
All times are GMT. The time now is 07:38 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0 ©2007, Crawlability, Inc.
Cheap Car Insurance - Compare Motor Insurance
Endsleigh Car Insurance Natwest Car Insurance
More Than Car Insurance Norwich Union Car Insurance
Prudential Car Insurance Zurich Car Insurance
Inactive Reminders By Mished.co.uk