我有数据,每一行/用户的格式如下:
{
first: <string>
active: <bool>
}
如果 active 属性为 false,我希望将背景颜色应用于整个行。目前我有这个,试图将样式应用于每一行
rowClassName = (rowData) => {
return {'greyed' : true}; //will be {'greyed': !rowData.active} but this is for demonstration
}
<DataTable value={this.props.users.toJS()} //in render
selectionMode="single"
selection={user}
onSelectionChange={this.props.dispatch.editAccount}
rowClassName={this.rowClassName}
>
<Column field="first" header="First" filter={true}/>
</DataTable>
.greyed{ //in css
background-color: red;
}
关于我应该尝试什么的任何想法?我在 3 天前在 primeFaces 论坛上发布了这个问题,但从未得到回复:https ://forum.primefaces.org/viewtopic.php?f=57&t=58605