diff options
Diffstat (limited to 'components/form-data')
| -rw-r--r-- | components/form-data/form-data-table.tsx | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/components/form-data/form-data-table.tsx b/components/form-data/form-data-table.tsx index 0f55c559..98cc7b46 100644 --- a/components/form-data/form-data-table.tsx +++ b/components/form-data/form-data-table.tsx @@ -117,6 +117,7 @@ export default function DynamicTable({ const [activeFilter, setActiveFilter] = React.useState<string | null>(null); const [filteredTableData, setFilteredTableData] = React.useState<GenericData[]>(tableData); + const [rowSelection, setRowSelection] = React.useState<Record<string, boolean>>({}); // 필터링 로직 React.useEffect(() => { @@ -343,15 +344,20 @@ export default function DynamicTable({ }, [selectedRowsData]); const columns = React.useMemo( - () => getColumns<GenericData>({ - columnsJSON, - setRowAction, - setReportData, - tempCount, - }), - [columnsJSON, setRowAction, setReportData, tempCount] + () => + getColumns({ + columnsJSON, + setRowAction, + setReportData, + tempCount, + onRowSelectionChange: setRowSelection, // ✅ 맞습니다 + templateData, + }), + [columnsJSON, tempCount, templateData] + // setRowSelection은 setState 함수라서 의존성 배열에서 제외 가능 + // (React가 안정적인 참조를 보장) ); - + function mapColumnTypeToAdvancedFilterType( columnType: ColumnType ): DataTableAdvancedFilterField<GenericData>["type"] { |
