I'm starting to make some progress with your help.  I've changed my
xml output and incorporated Alex and Tracy's suggestions.  I can now
see data in the ADG but its not quite what I expected.  Here's the 
what I get:

Period               Country         Detects
2008-12-04 03:00:00  PHGBMYDK        121341022
2008-12-04 04:00:00  AUGBMY          39211

The Source XML is:
<dashboard>
 <rollup period="2008-12-04 03:00:00">
  <country code="PH" detects="12" />
  <country code="GB" detects="134" />
  <country code="MY" detects="102" />
  <country code="DK" detects="2" />
 </rollup>
 <rollup period="2008-12-04 04:00:00">
...
 </rollup>
</dashboard>

My MXML fragrements of interest are:

<mx:AdvancedDataGrid 
        id="myDataGrid"
        dataProvider="{statFeed.rollup}"
        width="50%" 
        height="75%"
        verticalCenter="0" left="0">
  <mx:AdvancedDataGridColumn headerText="Period"  dataField="@period"/>
  <mx:AdvancedDataGridColumn headerText="Country"
labelFunction="getCountryCode"/>
  <mx:AdvancedDataGridColumn headerText="Detects"
labelFunction="getCountryDetects"/>
</mx:AdvancedDataGrid>

The functions getCountryDetects and getCountryCode are the same as
your label function (changed to appropriate label names.)

What I want is that each rollup period have a "spinner" that contains
a row for each country that displays the detects during that period.
For example, using the above data:

Period:                   Country           Detects
* 2008-12-04 03:00:00
                          PH                12
                          GB                134

Many thanks for all the help...
           

--- In [email protected], "oneworld95" <[EMAIL PROTECTED]> wrote:
>
> You'd probably want to use a labelFunction on each column where you
> want to do something to what the user sees. I think one of the links I
> sent you has info on creating labelFunctions. Here's an example,
> 
> // As described here: http://thanksmister.com/?p=8
> // Pulls data from XML nodes that are optional. 
> // Assumes your XML has an element called "image" that
> // has an attribute called "id".
> public function getImageID(item:Object,
> column:AdvancedDataGridColumn):String {
>   if (item.image == undefined) {
>     return null;
>   }
>   else {
>     return [EMAIL PROTECTED];
>   }
> }
> 
> In your ADG, you'd call this function like this:
> 
> <mx:AdvancedDataGridColumn labelFunction="getImageID" 
>   headerText="Image ID" />
> 
> -Alex
> 


Reply via email to