Aggregation programatically in DataGrid

Hello everyone. I’m adding columns to dataGrid programatically and after trying to aggregate this column by SUM type. But studio prints that there is must be at least one feild to aggregate. I fetching column, after setting via setAggregate() aggregate type SUM. But problem stays
2022-02-14_23-25-45

2022-02-14_23-04-14

Hi,

We will be able to help you if you attach a small demo project that demonstrates the issue.

Regards,
Gleb

Hello Gleb, we had the same problem, but for Custom type.
Jmix version 1.2.3
Here test project for you. Ofcourse it much easier. In our project we generate columns programatically.

Adding

val tableComposition = testEntitiesTable.unwrapComposition(TableComposition::class.java)
val table = tableComposition.table
if (table is AggregationContainer)
    table.addContainerPropertyAggregation(column.id, AggregationContainer.Type.SUM)

Helped us.
jmix-test.7z (67.2 KB)

Thank you for reporting the problem, I’ve created a GitHub issue.

For now, you can use a workaround that you’ve found.

Regards,
Gleb