Skip to content

Commit 2c74877

Browse files
trietlamtrietlam
and
trietlam
authoredAug 3, 2024··
docs: typo in multi-sorting guide (#5686)
Co-authored-by: trietlam <triet@conqahq.com>
1 parent a669e39 commit 2c74877

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed
 

‎docs/guide/sorting.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ const table = useReactTable({
202202
getSortedRowModel: getSortedRowModel(),
203203
sortingFns: { //add a custom sorting function
204204
myCustomSortingFn: (rowA, rowB, columnId) => {
205-
return rowA.original[columnId] > rowB.original[columnId] ? 1 : rowA.original[columnId] < rowB.original[columnId] ? -1 : 0
205+
return rowA.original[columnId] > rowB.original[columnId] ? 1 : rowA.original[columnId] < rowB.original[columnId] ? -1 : 0
206206
},
207207
},
208208
})
@@ -308,7 +308,7 @@ const columns = [
308308

309309
By default, the ability to remove sorting while cycling through the sorting states for a column is enabled. You can disable this behavior using the `enableSortingRemoval` table option. This behavior is useful if you want to ensure that at least one column is always sorted.
310310

311-
The default behavior when using either the `getToggleSortingHandler` or `toggleSorting` APIs is to cycle through the sorting states like this:
311+
The default behavior when using either the `getToggleSortingHandler` or `toggleSorting` APIs is to cycle through the sorting states like this:
312312

313313
`'none' -> 'desc' -> 'asc' -> 'none' -> 'desc' -> 'asc' -> ...`
314314

@@ -334,22 +334,22 @@ Sorting by multiple columns at once is enabled by default if using the `column.g
334334

335335
##### Disable Multi-Sorting
336336

337-
You can disable multi-sorting for either a specific column or the entire table using the `enableMultiSorting` column option or table option. Disabling multi-sorting for a specific column will replace all existing sorting with the new column's sorting.
337+
You can disable multi-sorting for either a specific column or the entire table using the `enableMultiSort` column option or table option. Disabling multi-sorting for a specific column will replace all existing sorting with the new column's sorting.
338338

339339
```jsx
340340
const columns = [
341341
{
342342
header: () => 'Created At',
343343
accessorKey: 'createdAt',
344-
enableMultiSorting: false, // always sort by just this column if sorting by this column
344+
enableMultiSort: false, // always sort by just this column if sorting by this column
345345
},
346346
//...
347347
]
348348
//...
349349
const table = useReactTable({
350350
columns,
351351
data,
352-
enableMultiSorting: false, // disable multi-sorting for the entire table
352+
enableMultiSort: false, // disable multi-sorting for the entire table
353353
})
354354
```
355355

0 commit comments

Comments
 (0)
Please sign in to comment.