更新记录时如何动态更新行背景颜色?

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

在 ng prime 数据 table 中更新记录后,我必须更改记录的背景颜色。 这个任务怎么做?

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

Ashutosh 你应该试试数据表的这个属性 [rowStyleClass]="lookupRowStyleClass"

使用以下 link 将其添加到您的代码中