Important Notice - Forums is archived
To simplify things and help our users to be more productive, we have archived the current forum and focus our efforts on helping developers on Stack Overflow. You can post new questions on Stack Overflow or join our Discord channel.

Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.
stylling grid rows and checkbox in grid rows
Win 7 64-bit
Java: 8
Vaadin version: 7.6.3
Hi
I wanto to change the row background color, but the tutorial example doesn´t work in my case:
// style
.v-grid-row.rowGreen {
background-color: darkgreen;
}
tblStockProduccion.setRowStyleGenerator((RowReference rowRef) -> {
String oper = (String) rowRef. getItem().getItemProperty("operario_id").getValue().toString();
if (oper.equals("Lopez")) {
// Modified style
return "rowGreen";
}
// No style
return null;
});
I don't know what is wrong.
I have to say that I use in similar way a CellStyleGenerator which works just fine.
And 2nd:
I still don't get it how to implement checkbox component in grid row.
Thanks in advance!
Aleksander
Hi!
I'm still waiting for some help.
Thanks.
Aleksander
Hi!
I just want to inform you that I solved - by myself - both problems. Nobody helped me.
Regards to row Style, I realized that I need 2 styles. There isn't such example in vaadin documentation to specify this.
v-grid-row.backgroundRed {
background-color: red;
color: white;
}
.v-grid-row.backgroundRed .v-grid-cell {
background-color: red;
color: white;
}
And second, I was able to implement the checkbox in a grid thanks to one video about vaadin grid.
This also should be explained and showed more simple in vaadin documentation.
Regards.
Aleksander