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

cancel
Showing results for 
Search instead for 
Did you mean: 
dharmraj
Active Member

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

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

2 Replies
eugenio_romano
Alfresco Employee

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

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
Member II

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

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>