IO-747 Update CCC auto pagination
This commit is contained in:
@@ -160,11 +160,13 @@ export default function ContractsJobsComponent({
|
||||
);
|
||||
|
||||
const defaultCurrent = useMemo(() => {
|
||||
return (
|
||||
Math.round(
|
||||
((filteredData.findIndex((v) => v.id === selectedJob) || 0) + 1) / 10
|
||||
) + 1
|
||||
);
|
||||
const page =
|
||||
Math.floor(
|
||||
(filteredData.findIndex((v) => v.id === selectedJob) || 0) / 3
|
||||
) + 1;
|
||||
console.log("Page", page);
|
||||
|
||||
return page;
|
||||
}, [filteredData, selectedJob]);
|
||||
|
||||
if (loading) return <LoadingSkeleton />;
|
||||
@@ -181,6 +183,7 @@ export default function ContractsJobsComponent({
|
||||
size="small"
|
||||
pagination={{
|
||||
position: "top",
|
||||
defaultPageSize: 3,
|
||||
defaultCurrent: defaultCurrent,
|
||||
}}
|
||||
columns={columns}
|
||||
|
||||
Reference in New Issue
Block a user