Search code examples
htmlcssangularprimeng-datatable

how to update row background color dynamically when record is updated?


I have to change background colour of a record after updating Record in ng prime Data table. How to do this task?

<p-dataTable [value]="cars" resizableColumns="true" columnResizeMode="expand">
    <p-column field="vin" header="Vin"></p-column>
    <p-column field="year" header="Year"></p-column>
    <p-column field="brand" header="Brand"></p-column>
    <p-column field="color" header="Color"></p-column>
</p-dataTable>

Solution

  • Ashutosh you should try this attribute of datatable [rowStyleClass]="lookupRowStyleClass"

    use following link to add this in your code click here