Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    List Grid Custom summary

    Isomorphic,

    I have a list grid with the below values.


    Column1 Column2 Column3

    2000 100 20
    250 50 5
    400 30 13.33

    2650 180 12.78

    I have 3 rows and Column3=Column1/Column2. I have used summary function for all three listgrid fields. For column1 and Column2 i have used SUM function and for Column 3 i have used AVG function. But as per our business logic the summary of column3 is SUM(Column1)/SUM(Column2) and not AVG(Column3)

    Please let me know what is the option for this?

    Thanks,
    Yathish

    #2
    You can set a custom grid summary function for that field in order to do the particular calculation you want.

    Comment


      #3
      Are there are any examples in showcase?? Please point out some links.

      Comment


        #4
        The API is literally ListGridField.setSummaryFunction(). Remember that the docs are searchable.

        Comment


          #5
          Isomorphic,

          if you look at my example, normal summary function wont help. I wanted to display some numbers in summary space which depends on some other two fields /columns.

          Thanks,
          Yathish

          Comment


            #6
            That is unusual, but the API does not constrain what data you can use in your summary function. You can use data from other columns, or even data that the grid is not aware of at all.

            Comment


              #7
              Is my requirement is unusual? What i need is a listgridfield summary which depends on other listgridfield summary.

              Comment


                #8
                Your custom summary function can do anything. In this case it sounds like you need to look at the array of records passed in, calculate the sum values from the fields you care about and return the value of one of these sums divided by the other.

                Comment

                Working...
                X