summaryrefslogtreecommitdiff
path: root/components/client-data-table/data-table-sort-list.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'components/client-data-table/data-table-sort-list.tsx')
-rw-r--r--components/client-data-table/data-table-sort-list.tsx6
1 files changed, 6 insertions, 0 deletions
diff --git a/components/client-data-table/data-table-sort-list.tsx b/components/client-data-table/data-table-sort-list.tsx
index b67fdde3..475a2798 100644
--- a/components/client-data-table/data-table-sort-list.tsx
+++ b/components/client-data-table/data-table-sort-list.tsx
@@ -64,6 +64,12 @@ export function ClientDataTableSortList<TData>({ table }: DataTableSortListLocal
const sortableColumns = React.useMemo(() => {
return 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.getCanSort())
.map((col) => ({
id: col.id,