In a Flex AdvancedDatGrid, we're doing a lot of grouping. Most of the columns are the same for the parents and for the children, so I'd like to show the first value of the group as the summary rather than the MAX, MIN or AVG
This code works on numerical but not textual values (without the commented line you get NaN's):
private function firstValue(itr:IViewCursor,field:String, str:String=null):Object
{
//if(isNaN(itr.current[field])) return 0 //Theory: Only works on Numeric Values?
return itr.current[field]
}
The XML:
(mx:GroupingField name="Offer")
(mx:summaries)
(mx:SummaryRow summaryPlacement="group")
(mx:fields)
(mx:SummaryField dataField="OfferDescription" label="OfferDescription" summaryFunction="firstValue"/)
(mx:SummaryField dataField="OfferID" label="OfferID" summaryFunction="firstValue"/)
(/mx:fields)
(/mx:SummaryRow)
(/mx:summaries)
(/mx:GroupingField)
OfferID's work Correctly, OfferDescriptions don't