mirror of
https://github.com/rowyio/rowy.git
synced 2026-02-24 04:01:17 +01:00
fix subtable cell
This commit is contained in:
@@ -24,7 +24,8 @@ export type CustomCellProps = FormatterProps<any> & {
|
||||
};
|
||||
|
||||
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<CustomCellProps>) => (
|
||||
if (updateCell)
|
||||
updateCell(props.row.ref, props.column.key as string, value);
|
||||
};
|
||||
|
||||
return (
|
||||
<ErrorBoundary fullScreen={false} basic>
|
||||
<Suspense fallback={<div />}>
|
||||
|
||||
@@ -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]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user