How can I see details to grid in Vaadin flow?

2019-08-27 13:53发布

In my Vaadin flow project, I have a grid and I set some items but it shows like grid data items

I want a decent format that a user can see specific details not like. Any idea or is there any component in vaadin to make this pretty?

1条回答
唯我独甜
2楼-- · 2019-08-27 14:43

There are two options to do that:

  • provide a better ValueProvider than the .toString(), that is used in your property right now. E.g.
grid.addColumn(person -> Integer.toString(person.getYearOfBirth()))
        .setHeader("Year of birth");
grid.addColumn(TemplateRenderer.<Person> of("<b>[[item.name]]</b>")
              .withProperty("name", Person::getName)).setHeader("Name");
查看更多
登录 后发表回答