Link to home
Start Free TrialLog in
Avatar of eduardo12fox
eduardo12foxFlag for Brazil

asked on

AdvancedDataGrid

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" 
	layout="vertical">

	<mx:Script>
		<![CDATA[			
			private function grpFunc(data:Object, column:AdvancedDataGridColumn):String
			{
				// add check for the presence of the properties here
				return data[gc.grouping.label] + " (" + data["summary"] + ")";
			}
		]]>
	</mx:Script>
	<mx:Array id="arr">
			<mx:Object From="Phill" Subject="GMC-1 Release" Date="12/08/06" CC="Jim"  Profit="69" />
			<mx:Object From="Phill" Subject="GMC-1 Release1" Date="12/08/06" CC="Jim"  Profit="31" />
			<mx:Object From="Harry" Subject="GMC-1 Release3" Date="November 2, 2006" CC="Ram"  Profit="10" />
			<mx:Object From="Barb" Subject="GMC-1 Release4" Date="12/08/06" CC="Anant"  Profit="20" />
			<mx:Object From="Amit" Subject="GMC-1 Release2" Date="12/07/06" CC="Jim"  Profit="28" />
			<mx:Object From="John" Subject="GMC-1 Release2" Date="12/07/06" CC="Jim"  Profit="12" />
			<mx:Object From="Amit" Subject="GMC-1 Release21" Date="12/07/06" CC="Jim"  Profit="22" />
	</mx:Array>
      
      <mx:AdvancedDataGrid id="adg" groupLabelFunction="grpFunc" creationComplete="gc.refresh();"  height="300">
            <mx:dataProvider>
                  <mx:GroupingCollection id="gc" source="{arr}" >
                        <mx:Grouping>
                              <mx:GroupingField name="From" >
                                    <mx:SummaryRow summaryPlacement="group">
                                          <mx:fields>
                                                <mx:SummaryField dataField="Profit" operation="COUNT" label="summary" />
                                          </mx:fields>
                                    </mx:SummaryRow>
                              </mx:GroupingField>
                        </mx:Grouping>
                  </mx:GroupingCollection>
            </mx:dataProvider>

            <mx:columns>
                  <mx:AdvancedDataGridColumn dataField="From"/>
                  <mx:AdvancedDataGridColumn dataField="Subject"/>
                  <mx:AdvancedDataGridColumn dataField="Date"/>
                  <mx:AdvancedDataGridColumn dataField="Profit"/>
            </mx:columns>
      </mx:AdvancedDataGrid>
</mx:Application>

Open in new window

Hello everybody,

I need to create a way to add a line for each group with the total value and quantity. I really need your help, sending attached an image made in photoshop with what I'm needing, I do not know where to start
grid.jpg
Avatar of zzynx
zzynx
Flag of Belgium image

This might help (although it's a pity that no screenshot is available):
http://www.java2s.com/Code/Flex/Grid/SummaryAdvancedDataGridwithSummaryRowandSummaryField2.htm

This has a row like you want:
http://livedocs.adobe.com/flex/3/html/help.html?content=advdatagrid_08.html (at the end of the page)
Avatar of eduardo12fox

ASKER

Unfortunately this is not what I need, I want to know how to put a line at the end of each group with the sum total
ASKER CERTIFIED SOLUTION
Avatar of eduardo12fox
eduardo12fox
Flag of Brazil image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
FINISH THIS QUESTION. THANKS
congratulations to me!! kkk