mirror of https://github.com/portainer/portainer
fix(react/datatable): override getColumnCanGlobalFilter method (#9991)
parent
004c86578d
commit
d3420f39c1
|
@ -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…
Reference in New Issue