A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://docs.dhtmlx.com/suite/grid/api/grid_group_config/ below:

Website Navigation


JavaScript Grid - group Config

group

Optional. Enables grouping row data by column values and allows configuring grouping settings

pro version only

The described functionality requires PRO version of the DHTMLX Grid (or DHTMLX Suite) package.

info

Note that when you initialize Grid with the group configuration property, the tree-like mode is enabled for Grid and it will have the type: tree property in its configuration.

Usage​
type TAggregate = "sum" | "count" | "min" | "max" | "avg" | string;

interface IGroupOrder {
map?: { [field: string]: [string, TAggregate] | ((row: IRow[]) => string | number) };
summary?: "top" | "bottom";
}

type IGroupOrderItem = string | IGroupOrder | ((row: IRow) => string);

interface IGroup {
panel?: boolean; // true by default
panelHeight: number; // 40 by default
hideableColumns?: boolean; // true by default
showMissed?: boolean | string; // true by default
fields?: { [colId: string]: IGroupOrder };
order?: IGroupOrderItem[];
column?: string | ICol;
}

interface IGridConfig {
...
group?: boolean | IGroup;
...
}
Parameters​

As an object the group configuration option has the following properties:

tip

You can find the detailed description of the group object properties with examples in the related guide Grouping data.

Example

const grid = new dhx.Grid("grid_container", {
columns: [
{ id: "country", header: [{ text: "Country" }], groupable: true },
{ id: "population", header: [{ text: "Population" }] },
{ id: "area", header: [{ text: "Land Area (Km²)" }] }
],
group: {
panel: true
},
data: dataset
});

Related article: Grouping data

Change log:

added in v9.0


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4