let {
getTableProps,
getTableBodyProps,
headerGroups,
prepareRow,
page,
canPreviousPage,
canNextPage,
nextPage,
previousPage,
state: { pageIndex, sortBy }
} = useTable(
{
columns,
data,
sortable: {dsiabledSort}
manualPagination: true,
manualSortBy: true
},
useSortBy,
usePagination
);
dsiabledSort is variable it will be either false or true, its set to true, but still table have sorting... I also tried simply
sortable:false
But still not working
Any help Thanks
On Version 7 if you want to disable sort on a single column use disableSortBy on columns definition, for example:
{
Header: 'Column Title',
accessor: 'title',
disableSortBy: true
}
Use the useSortBy hook with the disableSortBy option:
let {
getTableProps,
getTableBodyProps,
headerGroups,
prepareRow,
page,
canPreviousPage,
canNextPage,
nextPage,
previousPage,
state: { pageIndex, sortBy }
} = useTable(
{
columns,
data,
manualPagination: true,
manualSortBy: true,
disableSortBy: disabledSort // Add disableSortBy here
},
useSortBy,
usePagination
);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With