Style AdvancedDataGrid Summary Rows

I have an AdvancedDataGrid with summary rows. Everything works fine, but the user wants the summary rows bolded, so the totals stand out even when the categories are expanded. There don't seem to be any style properties, itemRenderers, or labelFunctions associated with any level of a GroupingCollection. How can I do this?
Thanks.
-John

I figured it out, so here it is for posterity:
I had to use the AdvancedDataGridColumn's styleFunction, and test the row object for a "GroupLabel" property. If it exists, bold the row, like below:
          protected function boldSummaryRows(row:Object, column:AdvancedDataGridColumn):Object {
                var styleObject:Object = new Object;
                if(row.hasOwnProperty('GroupLabel'))
                    styleObject.fontWeight = 'bold';
                return styleObject;

Similar Messages

  • AdvancedDataGrid Summary Row Max Function

    I am trying to mix summary function within an advanced data grid.   I'm trying to use the SUM function at the highest grouping level (Southwest).  And a MAX function at the sub regional level (Arizona, Central California, etc).    I want the SUM function at the Southwest level to add the results of the MAX functions from the sub regional level.   Is this possible?

    You can do something like this in order to get SUM function
    <!--  The grid -->
        <mx:AdvancedDataGrid  id="adg"
                width="100%" height="100%">
            <!-- Define grouping in dataProvider  -->
            <mx:dataProvider>
                <!-- Convert flat data to group  -->
                <mx:GroupingCollection  id="gc"
                        source="{svc.getOrders.lastResult}">
                    <mx:Grouping>
                        <!-- First group by customer -->
                        <mx:GroupingField name="CUSTOMER">
                            <!-- Calculate total per customer  -->
                            <mx:SummaryRow summaryPlacement="group">
                                <mx:fields>
                                    <mx:SummaryField dataField="PRICE"
                                                    operation="SUM"
                                                    label="Total"/>
                                </mx:fields>
                            </mx:SummaryRow>
                        </mx:GroupingField>
                        <!-- Then group by orderid -->
                        <mx:GroupingField name="ORDERID">
                            <!-- Calculate total per orderid  -->
                            <mx:SummaryRow summaryPlacement="group">
                                <mx:fields>
                                    <mx:SummaryField dataField="PRICE"
                                                    operation="SUM"
                                                    label="Total"/>
                                </mx:fields>
                            </mx:SummaryRow>
                        </mx:GroupingField>
                    </mx:Grouping>
                </mx:GroupingCollection>
            </mx:dataProvider>
            <!-- The grid columns-->
            <mx:columns>
                <!-- Empty colume for tree -->
                <mx:AdvancedDataGridColumn />
                <!-- Query columns -->
                <mx:AdvancedDataGridColumn  dataField="CUSTOMER"
                    headerText="Customer" />
                <mx:AdvancedDataGridColumn  dataField="ORDERID"
                    headerText="Order"/>
                <mx:AdvancedDataGridColumn  dataField="ARTNAME"
                    headerText="Item" />
                <mx:AdvancedDataGridColumn  dataField="PRICE"
                    headerText="Price" textAlign="right" />
                <!-- Column for calculated totals  -->
                <mx:AdvancedDataGridColumn  dataField="Total"
                    headerText="Total" textAlign="right" />
            </mx:columns>
        </mx:AdvancedDataGrid>

  • Customizing summary row AdvancedDatagrid

    i want to customise the look and feel of the summaryRow of the AdvancedDatagrid by including borders to the top and the bottom.I tried overriding createChildren() and adding HRule  as the first and last child of the summaryRenderer.The HRule is  getting added but it is not getting displayed.Am i doing somthing wrong.If so how can i customize the look and feel .Please suggest

    You can just use Renderer providers to customize your SummaryRow just like you use Renderer Providers for your columns.Specify the label name of the summary row that you want to customize in the renderer provider.

  • AdvancedDatagrid with a summary row

    Hello,
    I have an AdvancedDatagrid with two grouping fields in a
    summary row.
    Everything works fine when there is no labelFunction
    associated with it.
    But as soon as I specify a labelFunction, the summary row
    fields are empty. I need a labelFunction to format dates and
    numbers.
    How to write a proper labelFunction for an AdvancedDatagrid
    with a summary row ?
    Regards,
    Karl.

    Okay, I figured it out.
    Now, I have two label functions set at the
    AdvancedDataGridColumn level for the summary row fields and one
    labelFunction set at the AdvancedDataGrid level for all the other
    fields.
    <mx:AdvancedDataGridColumn id="amountTotal"
    dataField="sumAmount" labelFunction="sumAmountLabelFunction" />
    <mx:AdvancedDataGridColumn id="collectedTotal"
    dataField="sumCollected" labelFunction="sumCollectedLabelFunction"
    />
    In order to avoid a null pointer exception on the sumAmount
    and sumCollected fields in the label function, I use the
    hasOwnProperty() method to check before access. Otherwise, this
    exception will happen while expanding the tree.
    private function sumAmountLabelFunction(item:Object,
    column:AdvancedDataGridColumn):String
    if(item.hasOwnProperty("sumAmount"))
    return this.numberFormatter.format(item.sumAmount);
    return "";
    private function sumCollectedLabelFunction(item:Object,
    column:AdvancedDataGridColumn):String
    if(item.hasOwnProperty("sumCollected"))
    return this.numberFormatter.format(item.sumCollected);
    return "";

  • Summary rows

    I am new to Flex. I wasn't quite sure how to code summary
    rows in actionscript. Could some take a look at my codes and help
    me figure out why it doesn't work? I really appreciate it.
    I need to display a fixed data in group row. That is, I don't
    need to calculate the result to be displayed in group row.

    "irislpc" <[email protected]> wrote in
    message
    news:ghpdmn$s2k$[email protected]..
    > If I am not displaying the hierarchical data in
    AdvancedDataGrid by using
    > group
    > collection, can I still use summary rows? I populate the
    advanced data
    > grid
    > with external xml file. The xml is structured
    hierarchically so that I
    > don't
    > need to group the data. The problem is I have data that
    need to be
    > displayed in
    > group row. Can I use summaries function to do that?
    > Here is the sample application
    >
    http://www.irislin.net/itemRenderer/reliability.html
    http://livedocs.adobe.com/flex/3/html/help.html?content=advdatagrid_08.html
    "Note: Summary data is not supported for hierarchical data
    represented by
    the HierarchicalData class. You can only create summary data
    for data
    represented by the GroupingCollection class."
    I couldn't get at your app, since I'm not going to upgrade to
    Flash Player
    10 just to help you (I think that change is far more
    difficult to undo than
    to do), but you might find that you can make a
    GroupingCollection from your
    XML just by casting it.

  • String type data in Summary Row

    Hi,
    Can any one hlep out on this..
    I am working as a flex developer in one organization.I have a special scenario like,
    I want to display comments in Summary Row,
    But as per my knowledge Summary Rows can hold only numeric data.is it possible to display String type data in Summary row.
    If possible , please provide that piece of code.

    "nikos101" <[email protected]> wrote in
    message
    news:gq8693$9a$[email protected]..
    >I am using the following in a summary row in a
    AdvancedDataGrid. How would
    >I
    > modify it to also display a piechart with its data?
    >
    > package
    > {
    > import
    mx.controls.advancedDataGridClasses.AdvancedDataGridItemRenderer;
    > import mx.controls.listClasses.BaseListData;
    >
    > public class ItemTotalGBP_Renderer extends
    AdvancedDataGridItemRenderer
    > {
    > public function ItemTotalGBP_Renderer()
    > {
    > super();
    > }
    >
    > override public function set data(value:Object):void
    > {
    > super.data = value;
    > listData.label = " " + data["totalTransfers"]
    > +
    > " Transfers " + data["totalGBP_Eq"].toFixed(2) + " GBP
    equivalent";
    > }
    >
    > }
    > }
    The pie chart example here seems really close to what you
    want:
    http://www.adobe.com/livedocs/flex/3/html/help.html?content=advdatagrid_10.html

  • How can i create a grid with summary row

    Hello Professionals,
    I'm wondering how could i create a grid like the grid below, i want to create a grid with summary row,
    i have tried to create it using collapsing but it didn't work as required.
    Any suggestions?, i want to know just the starting point so i can make deep investigations.
    Thanks in Advance,

    Hi Karem,
    this can be achieved by just assigning a datatable containing the data plus some formatting of grid. Meaning there is no feature for that.
    The datatable can be filled manually or by sql query. Then you have to attach some events for updating the values ( validate after for gid item ).
    A small example for a sql query showing last month quotations and orders with summary :
    select 1 as Sort,cast(DocNum as varchar) as DocNum,DocTotal,convert(varchar, DocDate,104) from OQUT where DocDate between  DATEADD(month, -1, GETDATE()) AND GETDATE()
    UNION ALL
    Select 2 as Sort,'Summary ( Quotation ) : ',sum(DocTotal), convert(varchar,  DATEADD(month, -1, GETDATE()),104)+' - '+convert(varchar,   GETDATE(),104) from OQUT where DocDate between  DATEADD(month, -1, GETDATE()) AND GETDATE()
    UNION ALL
    select 3 as Sort,cast(DocNum as varchar) as DocNum,DocTotal,convert(varchar, DocDate,104) from ORDR where DocDate between  DATEADD(month, -1, GETDATE()) AND GETDATE()
    UNION ALL
    Select 4 as Sort,'Summary ( Order ) : ',sum(DocTotal), convert(varchar,  DATEADD(month, -1, GETDATE()),104)+' - '+convert(varchar,   GETDATE(),104) from ORDR where DocDate between  DATEADD(month, -1, GETDATE()) AND GETDATE()
    ORDER by Sort
    regards,
    Maik

  • How can I change the style of a row in tableview?

    Hi,
    How can I change the style of a row in tableview, for example ,I have 10 items in table view, and I'd like to change row 1,4,10 background-color:red; font-family:Arial ,Font-Weight:BOLD.
    Any suggestion?

    Yes, I knew how can I change the style using cell factory. there is a lot of work to do if it has so many columns in table view. we need to implement every cell factory, Do we have a simple way to change the whole row style , just like fabsav said, I 'd like to set the special row like this line:
    tableview.getItems().get(i).setStyle("myRowstyle"); And I found a bug if I implement my functionality with cell factory way, I can't change the cell style after rendering cell.
    protected void updateItem(Object object, boolean empty) {
          super.updateItem(object, empty);
    }updateItem() was only triggered while cell is being rendering, there is no way if I'd like to change the cell style after rendering event.
    Hi fabsav, How can I apply a CSS class to a specific row? Can you please provide a short example?
    Edited by: imtoocute on Aug 28, 2012 10:31 AM

  • Using Previous function in summary rows?

    Hi,
    I have a requirment, where I have to use the value got in previous column in the summary row.
    The scenario is as follows.
    There are Product, Quantity on Hand , Order Type and Date column. I am using cross tab, As I have to use the details of columns for each date.
    So date will be spreaded across table as there are more dates.
    In summary column, I would like to do a calcuation for each date. And I should use the calculated amount on one date in the next date and the calcuation continues.
    I am trying to use previous function, but its showing computation error.
    I am attaching a excel sheet with a sample example for easy understanding.
    The calculation which I used in summary row is avialble in formula section, when we select the column.
    Thanks in Advance.
    Regards
    Gowtham

    Hi BOCP,
    Yes, I am trying to use this function in Summary after Break.
    Sorry, I missed out attachment. And I didn't find a way to attach it.
    Suresh,
    I didn't find last() function in WebI Editor. I am using BO XI R2.
    Thanks a lot.
    Regards,
    Gowtham Sen.

  • Tabular form calculated summary row

    Hopefully this may be a quick question with either a yes or a no
    I have a tabular form with columns
    Project Name , Wk1 , Wk2 , Wk3 etc ,
    basically so PM's can track the hours against a project
    I have used the sum checkboxes to create a summary row
    but they also want a row that calculates how many hours remaining for each week under the week no cols , obviously subtracted ffrom the hours budget for each week assigned to the project and person
    I've done the summary and calculation in a view but this isn't acceptable as a UNION query in a tabular form
    I've also tried another region under the Tabular form but as the project name is a variable length its not easy keeping the Wk cols aligned
    thanks in advance
    Chris

    Hi Gus/Paul,
    I had the same requirements as you, resulting from the fact that newly added rows may not be visible to the user until he/she has scrolled down sufficiently, but, by lowering my standards (something I excel at :D ), I was able to find an acceptable compromise.
    As you probably noticed yourselves, when you "edit" the ADD button, you can see that a call is made to the addRow() javascript function. I therefore took a look at the javascript code - foolish really as I am an oracle DBA from the Jurassic period. Needless to say it scared the pants off me... So, fuelled by cowardice, I snatched at an inferior-but-dead-easy-to-implement alternative solution whereby the page is automatically "scrolled" to the bottom of the form when the "ADD" button is clicked.
    Should this "cop out" work for you, you can implement it in the following way:
    1. Create a new HTML region immediately after the tabular form, containing the following source: <font color="blue">&lt;a name="bottom_of_page"&gt;&lt;/a&gt;</font>
    2. Amend the action when the "ADD" button is clicked to scroll down to the new region by doing the following:
    - edit "ADD" button
    - Go to "Action when button Clicked" section
    - Amend "URL Target" from
    <font color="blue">Javascript:addRow();</font>
    <br>to
    <font color="blue">Javascript:addRow();window.location='#bottom_of_page'</font>
    <br>
    <br>Regards,
    Amr.

  • Adding a dynamic summary row for a spark data grid

    i'm looking for a solution for a spark data grid.
    by clicking on a row it will become larger and will show under the original row a some kind of a summary text with no realtion to columns.
    is there a summary row option for a spark datagrid that can shown by clicking on the row?

    Why would you need to make this part of the DataGrid? Just create some kind of view and bind it's data to the selectedItem of the DataGrid.
    *edit*
    Ohhhh, I see that you want it to display under the item. I believe you can do what you need in the skin, but I haven't had a chance to use the spark DataGrid yet so I can't say for sure. I know it has a feature to skin the selection, so I'm sure you can use that to do what you need.

  • Summary row in JTable

    I have created a JTable with some information. I want to have the last row of the table as a summary row so I want it to stand out. How would I go about putting the text in the last row of the table in bold font?
    Thanks for help!

    I looked at this example, but I thought that while the structure of the tutorial is good, the code might not be so great. Take for example the number renderer class, I won't repeat it here (might violate copyright) but the setValue method gets a number instance each time it is invoked to render a cell. My understanding is that this is inefficient, as getting an instance is a fairly involved procedure (it involves looking up locale information for instance). Also the code makes heap allocations which could potentially overwhelm the garbage collector (from what I've read).
    I'm learning java, and I used the example to make a decimal renderer. The main purpose of this is to show the number for the default locale and the specified number of decimal places:
    import java.text.NumberFormat;
    import java.text.DecimalFormat;
    import javax.swing.table.DefaultTableCellRenderer;
    public class DecimalRenderer extends DefaultTableCellRenderer {
        int precision = 0;   //my addition
        Number numberValue;   //moved from setValue()
        NumberFormat nf;   //moved from setValue()
        public DecimalRenderer(int p_precision) {
            super();   //same as example
            setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);  //same as example
            precision = p_precision;  //my addition
            nf = NumberFormat.getNumberInstance();  // moved from setValue
            nf.setMinimumFractionDigits(p_precision);  // my addition
            nf.setMaximumFractionDigits(p_precision);  // my addition
        public void setValue(Object value) {
          if ((value != null) && (value instanceof Number)) {
            numberValue = (Number) value;   // re-use the class member, not a local member
            value = nf.format(numberValue.doubleValue()); // same as example
          super.setValue(value);
      } By re-using the number instance and making the variables class level fields as opposed to local members of the setValue function, I expect to avoid the problems I mentioned above.
    Have I understood the situation correctly? I guess that experienced people would be aware of this, but I get annoyed by the examples I see as they typically give 'expedient' examples which seldom represent 'best practice'. Often, I can see that something probably isn't best practice, but I don't know what the best practice is.

  • Advanced Datagrid - Summary Row without groupping

    I need to make a datagrid with a summary row on top of it. It
    works fine with the gropping tag inside of groupping collection.
    But i don't need groups - i need only summaries.
    When I white following code inside of Advanced - flex crashes
    and tell something like "cannot null blablala".
    quote:
    <mx:GroupingCollection id="smallMetricsDataProvider"
    source="{bigMetrics}">
    <mx:summaries>
    <mx:SummaryRow summaryPlacement="first">
    <mx:SummaryField dataField="@type" operation="COUNT"
    />
    <mx:SummaryField dataField="@budget"
    summaryFunction="MetricsUtils.varianceTotalCount" />
    <mx:SummaryField dataField="@raw"
    summaryFunction="MetricsUtils.varianceTotalCount" />
    </mx:SummaryRow>
    </mx:summaries>
    </mx:GroupingCollection>
    What can you advice 4 me?
    Thanks, Roman.

    Fine, I found a way how to do it, using renderprovider 4
    folder items with a null height =))).
    It's a hack, the bad hack, i hope it wold be improved...
    So, i have another problem - i want to get this summary
    values. How?
    Thanks, Roman.

  • CSS styles for a row

    I want to include some css style for a row inside a table(which fetches results from database.)CSS style works for the table but not for the row inside.Pls help.
    Here is my code:(inside php script)
    echo "<table align=\"center\" class=\"studinfo\">
            <tr class=\"studinforow\"><td>Name:</td><td>".$row['Name']."</td></tr>
            <tr class=\"studinforow\"><td>Exam No:</td><td>".$row['Examno']."</td></tr>
            <tr class=\"studinforow\"><td>Roll No:</td><td>".$row['Rno']."</td></tr>
            <tr class=\"studinforow\"><td>Semester:</td><td>".$row['Sem']."</td></tr></table>";
    CSS code:
    .studinfo {
        margin-top: 20px;
        background-color: #E9F9FC;
        margin-bottom: 10px;
        width: 350px;
        font-family: Sintony;
        font-size: 13px;
        line-height: 22px;
        padding: 5px;
        border: 1px solid #AEE8F4;
        height: 150px;
    .studinforow {
        padding: 25px;

    I don't think padding works on the <tr> tag so you may find you need to add it to the <td> tag:
    <td class=\"studinforow\">Semester:</td><td class=\"studinforow\">".$row['Sem']."</td>
    You could just add the padding like below instead on every <td> tag:
    .studinfo td {
    padding: 25px;

  • In a ADG is it possible to have a pie chart in a summary row?

    In a ADG is it possible to have a pie chart in a summary row?
    The segments would be worked out from a funtion applied to the data
    in that grouping.
    Thanks :)

    The JTable is a tabular component. So it will always have enough columns to display the maximum row length. you don't have to pur a value in every cell.
    There are methods in JTable to remove horizontal and vertical lines and you could implement a renderer to make empty cells look like the background.
    Cheers
    DB

Maybe you are looking for

  • How do I use a master document to edit multiple documents?

    Hello, I was advised to move my post over here. My original question: I've been working on quite a few product sheets for the company I work for, and I've resorted to just using the Move Page tool to get all the templates the same, but that means I h

  • How can i sync email deletions on my iPhone and iMac, and vice versa?

    My email provider is Sky in the UK. While i am able to receive the same emails on both devices (imac and iphone) simultaneously, if I delete one on the iphone, it is not deleted on the iMac, and vice versa. I don't want to have to delete emails twice

  • How to install MSP on selected computers via GPO Startup VBscript

    Hi folks, I'm trying to write a vbscript that will run on startup and do the following: 1) Detect whether or not a particular application is installed 2) Determine if the latest version of said application is installed 3) If not, run the MSP update f

  • Java Hate Machine of death

    I recently put together a new build and installed windows 7 pro. Everything runs fine and it will run for weeks on end unless I restart it. I have the latest version of Java and decided to start playing minecraft and host a server. Everything is fine

  • Help with switching from Windows to Mac

    Does anyone know of any good sites that can help in teaching somebody how to use the mac operating system? Thanks