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

Loading…
Cancel
Save