JMIX 3 - GroupDataGrid with selectionMode="MULTI" behavior

GroupDataGrid (jmix-groupgrid-flowui): “select all” checkbox in header is present but hidden, and re-hides itself when forced visible

Hello,

We are using GroupDataGrid from the jmix-groupgrid-flowui add-on with selectionMode="MULTI", and we noticed a difference in behavior compared to the standard DataGrid component.

Expected behavior

With a standard DataGrid configured with selectionMode="MULTI", a “select all / deselect all” checkbox is automatically displayed in the column header, allowing the user to select or deselect all visible rows at once.

Actual behavior

With GroupDataGrid configured the same way (selectionMode="MULTI"), this checkbox does not appear visually. When inspecting the page with browser dev tools (F12), we can confirm that the checkbox element is present in the DOM, but it has a hidden state/attribute applied to it.

If we manually force this element to be visible through the dev tools:

  • it becomes clickable,
  • but clicking on it has no effect (no selection/deselection is triggered),
  • it automatically reverts back to its hidden state.

This suggests that some client-side logic actively re-applies this hidden state, rather than it being a simple CSS oversight.

Configuration example

<groupg:groupDataGrid id="dataGrid"
                       width="100%"
                       dataContainer="dc"
                       selectionMode="MULTI"
                       columnReorderingAllowed="true">
    <groupg:columns>
        <groupg:groupColumn key="group" header="Group"/>
        <groupg:column property="someProperty" resizable="true" autoWidth="true"/>
        <!-- ... other columns ... -->
    </groupg:columns>
</groupg:groupDataGrid>

Environment

  • jmix-groupgrid-flowui: 3.0.2
  • Jmix: 3.0.2
  • Vaadin (flow-server): 25.1.14

Questions

  1. Is this a known and intentional limitation of GroupDataGrid, related to some ambiguity in the “select all” semantics when grouping is enabled (e.g., should it select only visible/expanded rows, group rows, or all underlying items regardless of group state)?
  2. If so, is there a supported way to enable this “select all” checkbox for GroupDataGrid, or is the recommended approach to implement a custom “select all” button using dataGrid.select(items) / dataGrid.deselectAll() instead?
  3. If this is not intentional, could this be considered a bug to be fixed in a future release of the add-on?

Thank you in advance for your help.

Hello, Ewen!

  1. Yes, this is a known limitation of GroupDataGrid, and the header checkbox is hidden on purpose. Group rows in GroupDataGrid are synthetic: they exist only to render the grouping. A visible checkbox would select these group rows along with the real items. The problem is in the current implementation, which can’t guarantee a correct selection when grouping is enabled.

  2. There is currently no supported way to enable the checkbox for GroupDataGrid. The recommended approach is exactly what you suggested. For instance:

    @Subscribe("selectAllBtn")
    public void onSelectAllBtnClick(ClickEvent<JmixButton> event) {
        ordersDataGrid.select(ordersDc.getItems());
    }
    
    @Subscribe("deselectAllBtn")
    public void onDeselectAllBtnClick(ClickEvent<JmixButton> event) {
        ordersDataGrid.deselectAll();
    }
    
  3. We don’t consider it a bug: the current selection model just doesn’t know about group rows. We have an open issue for a group-aware multi-selection model: jmix-framework/jmix#4847. I’ve added the “select all” case there, so the same improvement will cover it. Unfortunately, there’s no release target yet.

Thank you for the clear explanation, that makes sense. We’ll go with the button-based workaround as suggested.

Thanks also for linking the existing issue (jmix-framework/jmix#4847) — we’ll keep an eye on it.

Appreciate the quick and clear response!

1 Like