Author Topic: column subtotal with grouped columns  (Read 2653 times)

stoodin

  • Pro Enterprise
  • Jr. Member
  • *
  • Posts: 85
    • View Profile
column subtotal with grouped columns
« on: April 14, 2014, 11:31:23 pm »
Hi guys,
I have a grid with subcolumns where I need to calculate a total.
For example I have a column Sunday and 2 subcolumns: Hours and Units. How do I calculate the sum for "Hours" and "Units"?
It seems like the callback function hasn't been called at all. I don't see any alerts showing.
I was trying to do something like:
    var colM=$grid.pqGrid( "option", "colModel");
    var colSubModel = colM[6].colModel;
    colM[0].summary = {
        type: [function( arr ){
            alert("Summary Calc");
                    eval(arr.join("+"));
                    return "Join: "+ arr.join(",");
               }
          ],
        title: [ "Total: {0}", "Join: {0}" ]
    };
   
    $grid.pqGrid("option","colModel",colM);

stoodin

  • Pro Enterprise
  • Jr. Member
  • *
  • Posts: 85
    • View Profile
Re: column subtotal with grouped columns
« Reply #1 on: April 15, 2014, 03:06:22 am »
No Worries. Fixed.
Thanks a lot.