Check documentation for the latest version of dhtmlxSuite groupBy DHTMLX Docs

groupBy

groups grid content by values of the specified column

void groupBy(number ind,array mask);
indnumbercolumn index to group by
maskarrayoptional, array, each value of which is mapped to the related column

Available only in PRO Edition

Example

//minimal parameters set. Group rows by the second column
myTreeGrid.groupBy(1);
//maximal parameters set
myTreeGrid.groupBy(2,["#stat_max","#title","","#stat_total",
                        "","#cspan","#cspan","#cspan"]);

Details

The values of the mask parameter are:

  • title (string) - mandatory, will be used for group-key;
  • cspan (string) - organize colspan with a sibling cell (the same as in cspan in header);
  • stat_total (number) - calculates total of values for the group;
  • stat_max (number) - calculates maximum value in the group;
  • stat_min (number) - calculates minimum value in the group;
  • stat_average (number) - calculates the average value in the group;
  • stat_count (number) - calculates count of records in the group.
Back to top