diff options
| author | dujinkim <dujin.kim@dtsolution.co.kr> | 2025-10-23 10:10:21 +0000 |
|---|---|---|
| committer | dujinkim <dujin.kim@dtsolution.co.kr> | 2025-10-23 10:10:21 +0000 |
| commit | f7f5069a2209cfa39b65f492f32270a5f554bed0 (patch) | |
| tree | 933c731ec2cb7d8bc62219a0aeed45a5e97d5f15 /components/form-data/form-data-table.tsx | |
| parent | d49ad5dee1e5a504e1321f6db802b647497ee9ff (diff) | |
(대표님) EDP 해양 관련 개발 사항들
Diffstat (limited to 'components/form-data/form-data-table.tsx')
| -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"] { |
