again problem with simple things
How can I remove columns from grid in this example ?
Grid<Person> grid = new Grid<>();
grid.setItems(getItems());
grid.addColumn(Person::getName).setHeader("Name");
grid.addColumn(Person::getAge).setHeader("Age");
again problem with simple things
How can I remove columns from grid in this example ?
Grid<Person> grid = new Grid<>();
grid.setItems(getItems());
grid.addColumn(Person::getName).setHeader("Name");
grid.addColumn(Person::getAge).setHeader("Age");
I found out a solution but maybe there is easier way to do it. Maybe someday will be a method like grid.RemoveAll()
Grid<Person> grid = new Grid<>();
grid.setItems(getItems());
grid.addColumn(Person::getName).setHeader("Name").setKey("Name");
grid.addColumn(Person::getAge).setHeader("Age").setKey("Age");
List<Grid.Column<Person>> columns = grid.getColumns();
for (Grid.Column column : columns) {
grid.removeColumnByKey(column.getKey());
}