Grid footer refresh

Hi, Is it posible to refresh the footer when I add/remove an element from my the Grid ?
I’m tryin with

grid.getDataProvider().addDataProviderListener(e → Notification.show(“Actualizando footer”));
but It doesn’t work.
Thanks.
image.png

That’s the right way to do but how do you remove/add the item?

Hi @faithful-emu this is mi implementation.
image.png
image.png

image.png

In your case, setItems will recreate a dataprovider ( then the listener does not exist in the new ). You can use removeItem from the data view: Binding Items to Components | Data Binding | Vaadin Docs

how did you add a footer?

Thanks @faithful-emu

Hi @yare-tiger you can create a footer using: grid.addColumn(ProformaDetalleDto::getCodigoBarra).setHeader(“Codigo Barra”).setFooter(“Text Footer”);

more information: https://vaadin.com/docs/next/components/grid/flow#column-headers-and-footers

Now It’s working with the helper methods in the ListDataView.
image.png
image.png

thank you @quintessential-crane , i guess its not possible with vaadin14?

No listdataview has been added in Vaadin 17.

But you can update the list in the dataprovider and call refresh all instead. But don’t recreate the dataprovider.

wait so there exists footer for vaadin14?

Yes: Grid | Components | Design System | Vaadin 14 Docs

niiiiiiice!

can i put a button into the footer?

yes i probably can, gonna tryy it out

hello, i cant figure out how to remove the footer?

`[…]
grid.getColumns().get(0).setFooter(download);
grid.getColumns().get(1).setFooter(new Checkbox(“Export with Children”));

    } else {
        grid.setSelectionMode(Grid.SelectionMode.SINGLE);
        grid.getColumns().get(0).setFooter("");
        grid.getColumns().get(1).setFooter("");`

You can hide the footer row: Feature: Removing HeaderRow from the Grid · Issue #1538 · vaadin/flow-components · GitHub
But I don’t think you can delete them