Use accessor instead of headers for matching cell data

This commit is contained in:
navaneeth 2021-09-01 15:49:36 +05:30
parent dd3dc82f01
commit d6525b6bf7

View file

@ -677,11 +677,12 @@ export function Table({
>
{row.cells.map((cell) => {
let cellProps = cell.getCellProps();
if (componentState.changeSet) {
if (componentState.changeSet[cell.row.index]) {
if (_.get(componentState.changeSet[cell.row.index], cell.column.Header, undefined) !== undefined) {
const accessor = columnData.find(column => column.id === cell.column.id)?.accessor;
if (_.get(componentState.changeSet[cell.row.index], accessor, undefined) !== undefined) {
console.log('componentState.changeSet', componentState.changeSet);
cellProps.style.backgroundColor = '#ffffde';
}