Skip to content

Commit

Permalink
feat: sort improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
mguellsegarra committed Feb 13, 2025
1 parent 9b0c628 commit b273ac6
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/components/PaginatedTable/PaginatedTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -503,7 +503,14 @@ const PaginatedTableComp = forwardRef<PaginatedTableRef, PaginatedTableProps>(

const handleSortChanged = useCallback(
(event: SortChangedEvent) => {
const sortState = event.api.getColumnState().filter((col) => col.sort);
const sortState = event.api
.getColumnState()
.filter((col) => col.sort)
.map((col) => ({
colId: col.colId,
sort: col.sort,
sortIndex: col.sortIndex,
}));
onSortChange?.(sortState);
},
[onSortChange],
Expand Down Expand Up @@ -571,7 +578,6 @@ const PaginatedTableComp = forwardRef<PaginatedTableRef, PaginatedTableProps>(
rowSelection={"multiple"}
onRowSelected={onRowSelectionChange}
suppressDragLeaveHidesColumns={true}
suppressMultiSort={true}
getRowHeight={undefined}
getRowId={getRowId}
rowStyle={rowStyle}
Expand Down

0 comments on commit b273ac6

Please sign in to comment.