This question might have answers already as I have seen some, which were not helped me to solve the issue. My issue is rowClass in ngx-datatable is not working for me.
Datatable code - test.component.html
<ngx-datatable class="material"
[rows]="rows"
[columnMode]="'force'"
[reorderable]="reorderable"
[rowClass]="getRowClass"
(activate)="onActivate($event)">
<ngx-datatable-column name="Cabinet Name" [flexGrow]="1">
<ng-template let-row="row" ngx-datatable-cell-template>
<mat-icon class='folder-color'>folder</mat-icon>
{{ row?.cabinetname }}
</ng-template>
</ngx-datatable-column>
</ngx-datatable>
TS Code - test.component.ts
getRowClass = (row) => {
return {
'row-color': true
};
}
SCSS Code - test.component.scss
.row-color {
background-color: green;
}
In chrome developer tools, it is showing row-color class as added, but rows are not getting the green as background color. I don't know what is wrong with the above code. Please guide me the right way to solve the issue.
Note: I am working on Angular 5
getRowClass = () => {}
solved the issue for me. Thanks a lot! – Cattier