GroupDataGrid Component
The groupDataGrid
component enhances the base data grid with robust row grouping features. It groups rows by repeated column values into collapsible group blocks with support for multi-level grouping and drag-to-reorder controls.
Basics
The following example groups customers based on their respective values in the Grade column.

XML code
<data>
<collection id="customersDc" class="com.company.groupdatagridex1.entity.Customer">
<loader id="customersDl" readOnly="true">
<query>
<![CDATA[select e from Customer e]]>
</query>
</loader>
<fetchPlan extends="_base"/>
</collection>
</data>
<groupg:groupDataGrid id="customersGroupDataGrid"
dataContainer="customersDc"
minWidth="100px"
width="100%">
<groupg:groupBy>
<groupg:columnRef key="grade"/> (1)
</groupg:groupBy>
<groupg:columns>
<groupg:groupColumn header="Grade"/> (2)
<groupg:column property="firstName"/>
<groupg:column property="lastName"/>
<groupg:column property="email"/>
<groupg:column property="country"/>
<groupg:column property="grade"/>
</groupg:columns>
</groupg:groupDataGrid>
1 | Initial grouping is by the grade property; more groupings can be added. |
2 | Group column definition. |
Data Binding
Data binding refers to linking a visual component to a data container. To bind a component to data use the dataContainer
attribute and reference collection container. See the example above.
Group Item
Group items are special records produced by grouping. They appear as rows that contain nothing but a group header.

To render group items, the data-binding layer creates a temporary, empty entity or DTO instance. This instance is not added to the collection container and exists only in memory for the duration of the grouping.
Hide Group Item Count
By default, group items display the number of descendants. Use the displayItemCount
property of groupColumn to hide this number.

Multi-level Grouping
The component supports grouping by multiple columns. Click the grouping column icon to open the Group by dialog, then add or remove columns.

Disable Grouping
To prevent users from grouping by a specific column, set its groupAllowed
property to false
. In the example below, the Country column cannot be grouped through the Group by dialog.

XML code
<groupg:groupDataGrid id="customersGroupDataGrid"
dataContainer="customersDc"
minWidth="100px"
width="100%">
<groupg:groupBy>
<groupg:columnRef key="grade"/>
</groupg:groupBy>
<groupg:columns>
<groupg:groupColumn header="Grade"/>
<groupg:column property="firstName"/>
<groupg:column property="lastName"/>
<groupg:column property="email"/>
<groupg:column property="country" groupAllowed="false"/>
<groupg:column property="grade"/>
</groupg:columns>
</groupg:groupDataGrid>
Columns with groupAllowed = false may be used for default grouping through the groupBy element. They can also be grouped programmatically using the groupBy() method.
|
Custom Grouping Column
To use a custom grouping value, describe a new grouping property in the view controller. The following example introduces a new grouping property that combines first and last name.

XML code
<groupg:groupDataGrid id="customersGroupDataGrid"
dataContainer="customersDc"
minWidth="100px"
width="100%">
<groupg:columns>
<groupg:groupColumn key="group" header="Full name"/> <!-- 1 -->
<groupg:column key="fullName" header="Full name"/>
<groupg:column property="email"/>
<groupg:column property="country"/>
<groupg:column property="grade"/>
</groupg:columns>
</groupg:groupDataGrid>
Java code
@ViewComponent
private GroupDataGrid<Customer> customersGroupDataGrid;
@Subscribe
public void onInit(InitEvent event) {
GroupDataGridItems<Customer> items = customersGroupDataGrid.getItems();
if (items != null) {
items.addGroupPropertyDescriptor( (1)
new BaseGroupPropertyDescriptor<Customer>("fullName",
context -> context.getItem().getFirstName() + " " + context.getItem().getLastName())
.withSortProperties(List.of("firstName", "lastName")));
customersGroupDataGrid.groupByKeys("fullName"); (2)
}
}
@Supply(to = "customersGroupDataGrid.fullName", subject = "renderer") (3)
protected Renderer<Customer> supplyRendererToFullNameColumn() {
return new TextRenderer<>(item -> item.getFirstName() + " " + item.getLastName());
}
1 | Describe a new grouping property that concatenates firstName and lastName . |
2 | Group by fullName by default. |
3 | Provide a render fallback for the Full Name column when it is not grouped; without this the column will appear empty. |
Export to Excel
Exporting functionality is provided by free Grid Export Actions add-on which supports all grid types: groupDataGrid
, dataGrid
, and treeDataGrid
.

The add-on provides two export options. For groupDataGrid
it affects both the scope and the generated spreadsheet formating:
-
All rows – Exports every row from the grid and flattens grouping: group labels become regular cell values placed in the first column.
-
Current page – Exports only the rows visible on the current page and preserves the grouping structure in the generated XLS file. Group headers and indentation are maintained so the exported spreadsheet reflects the same hierarchical layout you see in the grid.
Styling
Themes
Configure themes with the themeNames property. Multiple themes can be applied simultaneously. The themes are the same ones as in dataGrid.
Group Icon
The component shows +
for a collapsed group and -
for an expanded group. To customize, add your preferred icons to the application stylesheet. Replace the default content
values for the desired icon character codes (e.g., e7c1
and e7bf
taken from vaadin font icons collection):
vaadin-grid-tree-toggle.jmix-group-toggle {
&::part(toggle)::before {
content: "\e7c1";
}
&[expanded]::part(toggle)::before {
content: "\e7bf";
}
}

Learn more about stylable parts of components. |
Group Column Icon
The group column icon is customizable via the groupIcon
attribute of the groupColumn element. To hide the icon, set groupIconVisible
to false
.
Attributes
Common attributes serve the same purpose for all components. Below are the attributes shared with dataGrid and those unique to groupDataGrid
:
Name |
Description |
Default |
---|---|---|
If |
|
|
If |
|
|
The text to display when the table is empty. Use null to remove the current empty state content. See Empty State. |
– |
|
Sets the selection mode. Possible values: |
|
|
If the data in the component is aggregatable, determines whether the aggregation row is displayed above or below the other rows. Possible values: |
|
|
If Using this feature is discouraged for a large number of items as it may cause performance issues. |
– |
|
Sets the column rendering mode. In |
|
|
If |
|
|
Determines rows where a drop can happen. Possible values: |
– |
|
If |
|
|
If |
|
|
If |
|
|
Determines whether the clicked column is added to the end or beginning of the sorted columns list. Possible values: |
|
|
Sets the behavior when parsing nested properties which may contain null values in the property chain. Possible values: |
|
|
Determines the page size or the number of items that will be fetched from the data provider at a time. |
|
|
If |
|
|
If |
|
Handlers
Common handlers are configured in the same way for all components. Below are the handlers shared with dataGrid and those unique to groupDataGrid
:
To generate a handler stub in Jmix Studio, use the Handlers tab of the Jmix UI inspector panel or the Generate Handler action available in the top panel of the view class and through the Code → Generate menu (Alt+Insert / Cmd+N). |
Name |
Description |
---|---|
|
|
Fired when a group is collapsed. |
|
|
|
|
|
Fired when a group is expanded. |
|
|
|
|
|
|
|
Fired when a row that corresponds to a group item is clicked |
|
Fired when a row that corresponds to a group item is double-clicked. |
|
Fired when grouping changes — columns added or removed. |
|
|
|
|
|
A selection event that unifies the way to access to selection event for multi selection and single selection components (in case when only one selected item is required). |
|
|
|
Adds a data generator for the data grid. If the generator was already added, does nothing. See the |
|
Allows to control which specific rows can be dragged, rather than making all rows draggable with rowsDraggable. |
|
Allows to control which specific rows are valid drop targets. |
|
Handles the event when the user presses the Enter key. |
|
Generates parts of CSS class names for group items based on given conditions. This allows for customizing group items. |
|
Sets a predicate to check whether a specific item in the grid may be selected or deselected by the user. The predicate receives an item instance and should return |
|
Generates parts of CSS class names for cells based on given conditions. This allows for customizing cell appearance based on the data displayed. |
|
Generates tooltip for the column cell based on given conditions. See live demo. |
Elements
To add an element to a selected component click the Add button in the Jmix UI inspector panel. |
groupBy
The groupBy
element contains one or more columnRef
elements that reference the columns used for default grouping.
columns
The columns
element contains individual column
elements and defines a set of attributes shared by those columns.