Grid. How to update Footer when value in the Grid change?

Hi,

I have a Grid that contains a footer with a sum of column numeric values. What I need is to re-calculate this total value in the Footer whenever a row is added or a value is changed in the Column.
I have the code to recalculate but, since I can’t find a ValueChange or something similar I can’t figure how to call the recalulation method. Is there a straightforward way to achieve this?

Thanks and BR
Mariano

If you change values or add/remove items, it should trigger ItemSetChange event in the underlaying container. So one way to do what you want is to add that update code you have made in ItemSetChange event inside ItemSetChangeListernet.

If it is still relevant, below how I have done on Vaadin 14:

dataProvider.addDataProviderListener(changeEvent -> {
            quantityColumn.setFooter("Total Quantity: " + calculateTotalQuantityOnGrid(dataProvider));
            priceColumn.setFooter("Total Price: "+ calculateTotalPriceOnGrid(dataProvider));

});