Check documentation for the latest version of dhtmlxSuite groupBy DHTMLX Docs


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


//minimal parameters set. Group rows by the second column
//maximal parameters set


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