change default sort on logs tables closes #1907

This commit is contained in:
miloschwartz
2025-12-03 18:20:28 -05:00
parent a61c82570a
commit 4b580105cd
5 changed files with 9 additions and 5 deletions

View File

@@ -257,7 +257,10 @@ export function LogDataTable<TData, TValue>({
? {}
: { getPaginationRowModel: getPaginationRowModel() }),
onSortingChange: setSorting,
getSortedRowModel: getSortedRowModel(),
// Disable client-side sorting for server-side pagination since data is already sorted on server
...(isServerPagination
? {}
: { getSortedRowModel: getSortedRowModel() }),
onColumnFiltersChange: setColumnFilters,
getFilteredRowModel: getFilteredRowModel(),
onGlobalFilterChange: setGlobalFilter,
@@ -269,6 +272,7 @@ export function LogDataTable<TData, TValue>({
}
: {}),
initialState: {
sorting: defaultSort ? [defaultSort] : [],
pagination: {
pageSize: pageSize,
pageIndex: currentPage