Header text wrongly aligned when textAlign = END, sortable = False and Filterable = TRUE

Dear JMIX Team,

We are using JMIX 2.2 and we want to have columns in the data grid sortable = FALSE, but the textAlign = END

The header labels are displayed at start instead of at the end. You can see 2 examples one with sorter order display in green and one without Sortable, filterable = TRUE and the text is displayed to the left.

image

Hi!

I created an issue on our bug tracker: The dataGridHeaderFilter ignores the text align in the column · Issue #3467 · jmix-framework/jmix · GitHub

As a workaround, you can set the alignment for data grid header filter components yourself programmatically:

    @ViewComponent
    private DataGrid<User> usersDataGrid;

    @Subscribe
    public void onInit(InitEvent event) {
        usersDataGrid.getColumns().forEach(userColumn -> {
            if (userColumn.getHeaderComponent() instanceof DataGridHeaderFilter headerFilter) {
                Style style = headerFilter.getStyle();

                switch (userColumn.getTextAlign()) {
                    case END -> style.setJustifyContent(Style.JustifyContent.END);
                    case CENTER -> style.setJustifyContent(Style.JustifyContent.CENTER);
                    default -> { /* do nothing */ }
                }
            }
        });
    }

Result:
image

Best regards,
Dmitriy