fix(react/datatable): override getColumnCanGlobalFilter method (#9991)

pull/10002/head
Oscar Zhou 1 year ago committed by GitHub
parent 004c86578d
commit d3420f39c1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -3,6 +3,7 @@ import {
TableState,
useReactTable,
Row,
Column,
getCoreRowModel,
getPaginationRowModel,
getFilteredRowModel,
@ -130,6 +131,7 @@ export function Datatable<
getFacetedMinMaxValues: getFacetedMinMaxValues(),
getExpandedRowModel: getExpandedRowModel(),
getRowCanExpand,
getColumnCanGlobalFilter,
...(isServerSidePagination ? { manualPagination: true, pageCount } : {}),
meta,
});
@ -258,3 +260,10 @@ function globalFilterFn<D>(
return false;
}
function getColumnCanGlobalFilter<D>(column: Column<D, unknown>): boolean {
if (column.id === 'select') {
return false;
}
return true;
}

Loading…
Cancel
Save