【发布时间】:2021-03-19 08:36:23
【问题描述】:
public MyTabbedForm() {
this.refresh = new Button("");
this.refresh.addClickListener(buttonClickEvent -> {
this.grid.setItems(getCompany());
});
this.grid = new Grid<>();
this.grid.setWidthFull();
this.grid.addColumn(Company::getName).setHeader("Name");
this.grid.addColumn(company -> (company. getCompanyCode()))
.setHeader("Company Code");
this.grid.addColumn(company -> (company. getCompanyId()))
.setHeader("Company Id");
this.grid.addColumn(company -> (company. getCompanyStatus()))
.setHeader("Company Status");
this.grid.getColumns().forEach(col -> col.setAutoWidth(true));
add(this.refresh,this.grid);
}
但我可以根据内容增加列的宽度
【问题讨论】:
标签: java vaadin vaadin7 vaadin8