cancel
Showing results for 
Search instead for 
Did you mean: 

There is any way to add css in row based on condition in ADF-DataTable ?

dharmraj
Confirmed Champ
Confirmed Champ

I am using adf data table to render data .there is any way to add css based on even or odd row

2 REPLIES 2

eugenio_romano
Elite Collaborator
Elite Collaborator

Hi my suggestion, in general, is to give a look to the ADF repository documentation:

alfresco-ng2-components/docs at development · Alfresco/alfresco-ng2-components · GitHub 

This topic in general is covered here:

https://github.com/Alfresco/alfresco-ng2-components/blob/development/docs/core/datatable.component.m...

search for the key word css in the page that I linked you above.

JuanCarlos12
Champ in-the-making
Champ in-the-making

I know this is already years too late.

But I wa wondering if its possible to apply a style to a row based on the data included in that row.

I know that ng-template allows us to access the data in that row but only in a cell level. Is it possible to do it in a row level?

<data-column>
<ng-template let-entry="$implicit"></ng-template>
</data-column>

Something like

<ng-template let-entry="$implicit">
    <data-row [ngClass]="entry.row.getValue('name')==='value'?red-background:green-background">
        <data-columns>
        .....
        </data-columns>
    </data-row>
</ng-template>