Reputation: 23
I'm new to the vaadin. And I had a question how to create the numbering of lines in the grid using grid.addColumn(???).setHeader("#")
.
Upvotes: 2
Views: 155
Reputation: 10643
It would be easiest to do with TemplateRenderer this way
grid.addColumn(TemplateRenderer.of("[[index]]")).setHeader("#")
So then you would get index of the row in the column (which will not depend on Bean content, sorting etc.) There is more info about TempateRenderer in Vaadin Documentation
Upvotes: 2