如何在光环组件数据表中有条件地突出显示单元格?

How to highlight cell conditionally in aura component datatable?

我正在使用 Aura 组件构建闪电数据table,我在这个 table 中显示来自外部系统的数据,我想 select 一条或多条记录,以便我可以在 salesforce 中导入 selected 数据,导入后我想突出显示在 salesforce 中进行了 selected 和导入的行。

enter image description hereWhen you import data from external source than add an extra key value in json or js-object.,假设 isExternal 的值为 =''slds-theme_success" 并使用它是 lightningdatable 中的 cellAttributes,您可以在每一列中使用 cellAttributes 来突出显示整行。 例如:-

Columns=[{ label: 'test', fieldName:'test' , cellAttributes:{class: { fieldName: 'isExternal' }} } ];