Hi!
I have investigated the problem. This happens because the Vaadin Framework group cells and moves content when appending a new header row.
Here is the created issue for this problem.: Header text can't be displayed in a column with a header filter and top aggregation · Issue #3384 · jmix-framework/jmix · GitHub
The fix is planned for the upcoming 2.3 release.
To fix this right now, you can set the aggregatable property for the DataGrid programmatically in the controller (for example, at the InitEvent):
@ViewComponent
protected DataGrid<YourEntity> yourDataGrid;
@Subscribe
public void onInit(InitEvent event) {
yourDataGrid.setAggregatable(true);
}
Please note that the aggregationPosition property is specified using XML markup, but the aggregatable is set using Java code in the controller, since it is the aggregatable property triggers the initialization logic for the new header row.
<dataGrid id="yourDataGrid"
width="100%"
columnReorderingAllowed="true"
minHeight="20em"
dataContainer="yourDc"
aggregationPosition="TOP">
<!-- dataGrid content -->
</dataGrid>
This way, header filters will have time to initialize, and adding a header row will not break the displaying.
Best regards,
Dmitriy