[]
        
(Showing Draft Content)

Group Aggregates

The MultiRow control provides an aggregate property that allows you to display data summaries for the entire grid or for each group. 

To set the aggregators in the column footers, you can use the aggregate property and push GroupRow instances into the columnFooters.rows property. GroupRow instances hold the row data summary. 

The MultiRow control uses the layoutDefinition property to define column footer structures, allowing merged rows to display aggregated values based on specified conditions. 

If a column spans multiple cells in the grid, the footer cells for that column will also span accordingly. For example, if a column spans two rows in the grid, the footer cells for the column will also span two rows. 

The following sample shows how to implement the aggregate property.

import * as wjMultiRow from '@mescius/wijmo.grid.multirow'; 
 
// Adding GroupRow to to Column Footers to display aggregated values.  
   flexgrid.columnFooters.rows.push(new wjGrid.GroupRow());  

// Multirow grid with a layout definition of 3 rows. Each row corresponds to one row in the footer.  
   multirow.columnFooters.rows.push(new wjGrid.GroupRow());  
   multirow.columnFooters.rows.push(new wjGrid.GroupRow());  
   multirow.columnFooters.rows.push(new wjGrid.GroupRow());  

type=note

Note:

  • While displaying a summary in columnFooters, ensure the number of pushed rows matches the number specified in the layoutDefinition. If fewer rows are pushed, only the corresponding column data will be displayed.

    For example, in a layout with 3 rows, pushing only 2 rows will display the summary for columns in the first 2 rows.

  • For a custom layout of the columnFooter other than the one specified in the layoutDefinition property, implement a custom MergeManager and handle the formatItem event to display the correct data.