diff options
Diffstat (limited to 'components/data-table')
| -rw-r--r-- | components/data-table/data-table-group-list.tsx | 6 | ||||
| -rw-r--r-- | components/data-table/data-table-sort-list.tsx | 7 |
2 files changed, 13 insertions, 0 deletions
diff --git a/components/data-table/data-table-group-list.tsx b/components/data-table/data-table-group-list.tsx index 213b429f..c00fac42 100644 --- a/components/data-table/data-table-group-list.tsx +++ b/components/data-table/data-table-group-list.tsx @@ -85,6 +85,12 @@ export function DataTableGroupList<TData>({ () => table .getAllColumns() + .flatMap((column) => { + if (column.columns && column.columns.length > 0) { + return column.columns.filter(c => c.getCanSort()); + } + return column.getCanSort() ? [column] : []; + }) .filter((col) => col.getCanGroup?.() !== false) .map((col) => ({ id: col.id, diff --git a/components/data-table/data-table-sort-list.tsx b/components/data-table/data-table-sort-list.tsx index 21926f34..85484b09 100644 --- a/components/data-table/data-table-sort-list.tsx +++ b/components/data-table/data-table-sort-list.tsx @@ -108,6 +108,13 @@ export function DataTableSortList<TData>({ () => table .getAllColumns() + .flatMap((column) => { + // 그룹 컬럼이면 leaf 컬럼만 추출 + if (column.columns && column.columns.length > 0) { + return column.columns.filter(c => c.getCanSort()); + } + return column.getCanSort() ? [column] : []; + }) .filter( (column) => column.getCanSort() && !sorting.some((s) => s.id === column.id) |
