We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I have a grid with 2 columns. I added a button
When toggling the visibility of the second column it's header is not updated.
I would expect the column header to be updated
package org.vaadin.example; import java.util.ArrayList; import java.util.List; import com.vaadin.flow.component.button.Button; import com.vaadin.flow.component.grid.Grid; import com.vaadin.flow.component.grid.Grid.Column; import com.vaadin.flow.component.orderedlayout.VerticalLayout; import com.vaadin.flow.router.Route; @Route public class MainView extends VerticalLayout { public static class Person2 { private String name1; private String name2; public String getName1() { return name1; } public void setName1(String name1) { this.name1 = name1; } public String getName2() { return name2; } public void setName2(String name2) { this.name2 = name2; } } public MainView() { Grid<Person2> myGrid = new Grid<>(); myGrid.addColumn(Person2::getName1).setKey("Name1").setHeader("Name1"); myGrid.addColumn(Person2::getName2).setKey("Name2").setHeader("Name2"); List<Person2> items = new ArrayList<>(); Person2 person2 = new Person2(); person2.setName1("Henry1"); person2.setName2("Michael1"); items.add(person2); person2 = new Person2(); person2.setName1("Henry2"); person2.setName2("Michael2"); items.add(person2); myGrid.setItems(items); Button myGridButton = new Button("show Name2", e -> { Column<Person2> column = myGrid.getColumnByKey("Name2"); if (!column.isVisible()) { column.setVisible(true); column.setHeader(column.getHeaderText() + " X"); System.out.println("ColumnHeader: " + column.getHeaderText()); items.forEach(item -> item.setName2(item.getName2() + " X")); myGrid.getListDataView().refreshAll(); } else { column.setVisible(false); } }); add(myGridButton, myGrid/*grid, select, name, sayHello*/); } }
see above
Vaadin version(s): 23.3.24, 24.0.2 OS: Windows
No response
The text was updated successfully, but these errors were encountered:
tomivirkki
Successfully merging a pull request may close this issue.
Description
I have a grid with 2 columns.
I added a button
When toggling the visibility of the second column it's header is not updated.
Expected outcome
I would expect the column header to be updated
Minimal reproducible example
Steps to reproduce
see above
Environment
Vaadin version(s): 23.3.24, 24.0.2
OS: Windows
Browsers
No response
The text was updated successfully, but these errors were encountered: