Flex AdvancedDataGrid: How do I style the summary rows?

13,196

in the past when I have need to do this I had to put a condition in my style function to try and determine if it is a summary row or not.

public function dataGrid_styleFunction (data:Object, column:AdvancedDataGridColumn) : Object  
{  
      var output:Object;  

      if ( data.children != null )  
      {  
          output = {color:0x081EA6, fontWeight:"bold", fontSize:14}  
      }  


      return output;  
  }  

if it has children, it should be a summary row. I am not sure this is the quote/unquote right way of doing this, but it does work, at least in my uses.

HTH

Share:
13,196

Related videos on Youtube

Mike Sickler
Author by

Mike Sickler

Updated on May 06, 2022

Comments

  • Mike Sickler
    Mike Sickler about 2 years

    I have an AdvancedDataGrid with a GroupingCollection and a SummaryRow. How do I display the summary row data in bold? Below is my code:

    <mx:AdvancedDataGrid width="100%" height="100%" id="adg" defaultLeafIcon="{null}"  > 
        <mx:dataProvider>
            <mx:GroupingCollection id="gc" source="{dataProvider}">
                <mx:Grouping>
                    <mx:GroupingField name="bankType">
                        <mx:summaries>
                          <mx:SummaryRow summaryPlacement="group" id="summaryRow">
                            <mx:fields>
                                <mx:SummaryField dataField="t0" 
                                    label="t0" operation="SUM" />
                            </mx:fields>
                          </mx:SummaryRow>
                        </mx:summaries>                    
                    </mx:GroupingField>
                </mx:Grouping>
            </mx:GroupingCollection>
        </mx:dataProvider>
                      <mx:columns>
            <mx:AdvancedDataGridColumn dataField="GroupLabel" 
                headerText=""/>
            <mx:AdvancedDataGridColumn dataField="name" 
                headerText="Bank" />
            <mx:AdvancedDataGridColumn dataField="t0"
                headerText="Amount" formatter="{formatter}"/>
        </mx:columns>            
    
    </mx:AdvancedDataGrid>    
    
  • vijayakumar flex
    vijayakumar flex about 14 years
    i used to my project . it is working now . thank you RYanGuill