jQWidgets Forums

jQuery UI Widgets Forums Grid Subgroup Total

This topic contains 1 reply, has 2 voices, and was last updated by  Peter Stoev 6 years, 2 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • Subgroup Total #103799

    parthrawal
    Participant

    Hi,
    I have multiple groups in my jqxgrid. where I could add grand total for each column. but unable to add toal for groups. Following is my code for creating columns. I have tried “group aggregate” but it is not working

    for (var iMonth = 0; iMonth < month.length; iMonth++) {
            var monthColumns = {}
            //var _aggregates = [{
            //    '<b>Total</b>':
            //        function (aggregatedValue, currentValue, column, record) {
            //            var sumPrice = $(curGridId).jqxGrid('getcolumnaggregateddata', month[iMonth] + iMonth.toString(), ['sum']);
            //            return sumPrice.sum;
            //        }
            //}];
            monthColumns['text'] = month[iMonth];
            monthColumns['datafield'] = month[iMonth] + iMonth.toString();
            monthColumns['map'] = iMonth.toString();
            monthColumns['width'] = 125;
            monthColumns['cellsalign'] = 'Right';
            monthColumns['aggregates'] = ['sum'];
            monthColumns['cellsrenderer'] = _cellsrenderer;
            //monthColumns['aggregatesrenderer'] = _aggregates;
            monthColumns['cellsformat'] = 'c2';
            monthColumns['draggable'] = false;
            monthColumns['cellclassname'] = cellclass;
            monthColumns['cellvaluechanging'] = cellvaluechanging;
            //monthColumns['columntype'] = 'numberinput';
            finalArray.push(monthColumns);
        }
    Subgroup Total #103821

    Peter Stoev
    Keymaster

    Hi parthrawal,

    The code you’re presenting here contains things not relevant to our Grid. I would suggest you to look at: https://www.jqwidgets.com/jquery-widgets-demo/demos/jqxgrid/grid-grouping-aggregates.htm?light to learn how to put group aggregates in your Grid control

    Regards,
    Peter

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.