I try to use ViewEncapsulation.None to insert background color to the kendo-grid-column as I found here, but my local CSS become the global, so it effect to other component. please tell me how to set it local only or remove it after the component destroyed.
This is my code:
xxx.component.ts
...
@Component({
selector: 'app-gnb6100',
templateUrl: './xxx.component.html',
encapsulation: ViewEncapsulation.None,
styleUrls: ['./xxx.component.css']
})
...
rowCallback(context: RowClassArgs){
if (context.dataItem.serviceStatusDesc === 'Deactivated'){
return { deactivated: true };
} else {
return {};
}
}
...
xxx.component.html
...
<kendo-grid
scrollable="virtual"
[data]="data"
[sortable]="true"
[sort]="sort"
[rowClass]="rowCallback"
[resizable]="true"
[reorderable]="true"
>
<kendo-grid-column width="100" class="cen" field="userID" title="ID" ></kendo-grid-column>
<kendo-grid-column width="100" field="userName" title="Username"></kendo-grid-column>
</kendo-grid>
...
xxx.component.css
...
.k-grid tr.deactivated{ background-color: #e5e5e5;}
...
And sorry for my poor English.