<ejs-listview id='listview' [dataSource]='groupData' [fields]='fields'></ejs-listview>
public fields: Object = { htmlAttributes:'Attributes'};
public groupData: any = [
{
"text": "Audi A4",
"id": "9bdb",
"category": "Audi",
"Attributes": {class:"list1"}
},
{
"text": "Audi A5",
"id": "4589",
"category": "Audi",
"Attributes": {class:"list2"}
},
];
<style>
#listview .list1 {
background-color:blue;
}
#listview .list2 {
background-color: skyblue;
font-style: italic;
color: Yellow;
}
</style> |
<style>
#listview li:nth-child(even) {
background-color: blue;
font-style:italic;
}
#listview li:nth-child(odd) {
background-color: skyblue
}
</style> |