added cell background of empty rows (#6353)

* added cell background of empty rows
This commit is contained in:
haojin111 2021-08-30 15:48:10 +08:00 committed by GitHub
parent b892712685
commit 1021c18dd5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -329,9 +329,12 @@ export const renderEmptyRows = (
<div {...rowProps} className="tr" key={index}>
{multiRowSelection && renderCheckBoxCell(false)}
{row.cells.map((cell: any, cellIndex: number) => {
return (
<div {...cell.getCellProps()} className="td" key={cellIndex} />
);
const cellProps = cell.getCellProps();
if (columns[0]?.columnProperties?.cellBackground) {
cellProps.style.background =
columns[0].columnProperties.cellBackground;
}
return <div {...cellProps} className="td" key={cellIndex} />;
})}
</div>
);