简体   繁体   中英

Vaadin Grid numbering of the rows

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("#") .

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM