Hiding Total Aggregation at the bottom of table

I have a group table that I have grouped by Currency field. It displays the group total for each currency but how do I hide the total amount at the bottom of the group table ?

This amount should not be displayed because amounts for different currencies must never be added together.

See image below

Hi Robert,

So you mean that the aggregation should be removed in case a user groups by the currency field, but for other columns it should be displayed?

Or do you mean it should never be aggregated at all?

Bye
Mario

I was referring to hiding the total aggregation at the bottom of the table at all times.

If it were to be hidden whenever the table is grouped by currency then that would be okay as well. I still need to see the totals for each currency though.

I see.

For this, you can use showTotalAggregation="false" on the table from my understanding. See also: Table (CUBA 7.2 API)

Cheers
Mario

I tried using that option but it does not work.
All this is being done in a fragment. Should that make a difference ?

I have tried using showTotalAggregation=“false” but the bottom total line is still showing.

My code is as follows:

visitsTable.getColumn("currency.description").setCollapsed(false);
visitsTable.groupByColumns("currency.description");
visitsTable.expandAll();
visitsTable.setAggregatable(true);
visitsTable.setShowTotalAggregation(false);

Hello!

Setting showTotalAggregation="false" does not work at run time, the row disappears only after page refresh. It will work if the property is set before the table is shown (e.g. in InitEvent).

However, there is a problem with the BOTTOM total aggregation because it does not disappear at all. I created an issue: cuba-platform/cuba#3194.

As a workaround try to change aggregation row style to the TOP or don’t set BOTTOM style:

@Subscribe
public void onInit(InitEvent event) {
    ordersTable.setAggregatable(true);
    ordersTable.setAggregationStyle(Table.AggregationStyle.TOP);
    ordersTable.setShowTotalAggregation(false);
}
2 Likes

Thank you. That workaround works for me !