1. #1
    Sencha User
    Join Date
    Jun 2012
    Posts
    16
    Answers
    1
    Vote Rating
    0
    kurasp is on a distinguished road

      0  

    Default Answered: Grid Summary calculated value for column

    Answered: Grid Summary calculated value for column


    Is there a way to get the record or more specifically the column, for a Ext.grid.feature.Summary?

    Pawel

  2. I was unable to get access to the summary row, so:
    1) I created a separate grid for just the summary row
    2) added listeners to the main grid panel that would calculate the sums and update the summary grid.
    This actually worked out well, because the client wanted the summary row to not scroll with the rest of the grid, which occurs with Ext.grid.feature.Summary

  3. #2
    Sencha - Support Team scottmartin's Avatar
    Join Date
    Jul 2010
    Location
    Houston, Tx
    Posts
    8,653
    Answers
    618
    Vote Rating
    402
    scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future

      0  

    Default


    See if this helps:
    http://jsfiddle.net/RMfzF/1/

    If not, please provide a little more detail.

    Scott.

  4. #3
    Sencha User
    Join Date
    Jun 2012
    Posts
    16
    Answers
    1
    Vote Rating
    0
    kurasp is on a distinguished road

      0  

    Default


    Thanks for the quick reply Scott,

    In the jsfiddle code you linked, is there a way to access the last row with values 600, 300 and 900?

    Pawel

  5. #4
    Sencha - Support Team scottmartin's Avatar
    Join Date
    Jul 2010
    Location
    Houston, Tx
    Posts
    8,653
    Answers
    618
    Vote Rating
    402
    scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future

      0  

    Default


    Add a load listener to your store:

    Code:
    listeners : {
        load  : function(store, records){
            console.log(records);
        }
    }

  6. #5
    Sencha User
    Join Date
    Jun 2012
    Posts
    16
    Answers
    1
    Vote Rating
    0
    kurasp is on a distinguished road

      0  

    Default


    records will return all rows(3) except the summary row (last row).

    In other words it would return an array containing:
    [{Month1: 100, Month2: 50, total: 150}, {Month1: 200, Month2: 100, total: 300 },{Month1: 300, Month2: 150, total: 450}]

    I would like to get the summary row.

    Ideally, I would like to get it directly from the grid(Ext.grid.panel), and not a load event, but I can't seem to find how to access it from the grid.

  7. #6
    Sencha User
    Join Date
    Jun 2012
    Posts
    16
    Answers
    1
    Vote Rating
    0
    kurasp is on a distinguished road

      0  

    Default


    Anybody have any ideas? or do I have to just recalculate the totals manually?

  8. #7
    Sencha User
    Join Date
    Jun 2012
    Posts
    16
    Answers
    1
    Vote Rating
    0
    kurasp is on a distinguished road

      0  

    Default


    I was unable to get access to the summary row, so:
    1) I created a separate grid for just the summary row
    2) added listeners to the main grid panel that would calculate the sums and update the summary grid.
    This actually worked out well, because the client wanted the summary row to not scroll with the rest of the grid, which occurs with Ext.grid.feature.Summary

  9. #8
    Sencha Premium Member
    Join Date
    Feb 2011
    Posts
    48
    Vote Rating
    -3
    sblommers is infamous around these parts

      0  

    Default


    The calculations are incorrect in 4.2.x

    Remove 1 summary from a column and see the difference when switching between 4.1.1 and 4.2.x in jsFiddle.

    Like this example: http://jsfiddle.net/yWKGg/

Thread Participants: 2

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar