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.

[color=#0000FF]
[size=2]

v-grid-row.backgroundRed {
   background-color: red;
   color: white;   
}
.v-grid-row.backgroundRed .v-grid-cell {
   background-color: red;
   color: white;   
}

[/size]
[/color]

[size=3]
[color=#000000]
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
[/color]
[/size]