diff --git a/www/src/components/Table/formatters/withCustomCell.tsx b/www/src/components/Table/formatters/withCustomCell.tsx index b887d10c..d20dc676 100644 --- a/www/src/components/Table/formatters/withCustomCell.tsx +++ b/www/src/components/Table/formatters/withCustomCell.tsx @@ -24,7 +24,8 @@ export type CustomCellProps = FormatterProps & { }; const getCellValue = (row, key) => { - return _get(row, key); + if (key.includes(".")) return _get(row, key); + return row[key]; }; /** * HOC to wrap around custom cell formatters. @@ -41,7 +42,6 @@ const withCustomCell = (Component: React.ComponentType) => ( if (updateCell) updateCell(props.row.ref, props.column.key as string, value); }; - return ( }> diff --git a/www/src/components/Table/index.tsx b/www/src/components/Table/index.tsx index 97f67991..4852a82c 100644 --- a/www/src/components/Table/index.tsx +++ b/www/src/components/Table/index.tsx @@ -126,14 +126,16 @@ export default function Table() { const rowHeight = tableState.config.rowHeight; const rows = tableState.rows; //const rowGetter = (rowIdx: number) => rows[rowIdx]; - const rowGetter = (rowIdx: number) => - columns.reduce( + const rowGetter = (rowIdx: number) => ({ + ...rows[rowIdx], + ...columns.reduce( (acc, currColumn) => ({ ...acc, [currColumn.key]: _get(rows[rowIdx], currColumn.key), }), {} - ); + ), + }); // rows[rowIdx]