color for alternate row in list control

Hi,

You previously showed a snippet on how to set color for alternate items in a list control, using following style:

<style>    
.rows .webix_list_item:nth-child(2n){
  background-color:#F5F5F5;
}
</style>

http://webix.com/snippet/dde7f783

Problem: This does not work correctly if select: “true” and you select a row with the alternate color.

How can this be fixed? (to work independently of selected skin…)

Thanks

You need to redefine the selection styles for alternative items in the same way

<style>    
.rows .webix_list_item:nth-child(2n){
  background-color:#F5F5F5;
}
.rows .webix_list_item.webix_selected:nth-child(2n){
  color: #FFF;
  background: #27AE60;
}
</style>

http://webix.com/snippet/8a468714

How can i do the same thing for a datatable ?

.rows .webix_cell:nth-child(2n){
  background-color:#F5F5F5;
}
.rows .webix_cell.webix_row_select:nth-child(2n){
  color: #FFF;
  background: #27AE60;
}

http://webix.com/snippet/b926e9c2