Case sensitive Sorting in tanstack react-table v8

597 Views Asked by At

I want case-sensitive sorting but It's not working in Tanstack react-table v8.

In the documentation I can see alphanumericCase sensitive is there. But I'm not able to understand how to apply this mode. enter image description here

Code:

const table = useReactTable<TData>({
data: dataMemoised,
columns: columnsMemoised,
state: {
  columnVisibility,
  columnOrder,
  columnPinning,
  rowSelection,
  sorting,
},
enableRowSelection: true,
enableSortingRemoval: false,
onRowSelectionChange: setRowSelection,
onColumnVisibilityChange: setColumnVisibility,
onColumnOrderChange: setColumnOrder,
onColumnPinningChange: setColumnPinning,
getCoreRowModel: getCoreRowModel(),
getRowId,
onSortingChange: setSorting,
getSortedRowModel: getSortedRowModel(),


})

Am I missing to add anything here?

1

There are 1 best solutions below

1
mohamed amine On

try this inside your column : sortingFn: 'alphanumericCaseSensitive'