IO-747 Update CCC auto pagination

This commit is contained in:
Patrick Fic
2021-03-09 09:27:14 -08:00
parent 43c771b4f6
commit 0ab019b9f7

View File

@@ -160,11 +160,13 @@ export default function ContractsJobsComponent({
); );
const defaultCurrent = useMemo(() => { const defaultCurrent = useMemo(() => {
return ( const page =
Math.round( Math.floor(
((filteredData.findIndex((v) => v.id === selectedJob) || 0) + 1) / 10 (filteredData.findIndex((v) => v.id === selectedJob) || 0) / 3
) + 1 ) + 1;
); console.log("Page", page);
return page;
}, [filteredData, selectedJob]); }, [filteredData, selectedJob]);
if (loading) return <LoadingSkeleton />; if (loading) return <LoadingSkeleton />;
@@ -181,6 +183,7 @@ export default function ContractsJobsComponent({
size="small" size="small"
pagination={{ pagination={{
position: "top", position: "top",
defaultPageSize: 3,
defaultCurrent: defaultCurrent, defaultCurrent: defaultCurrent,
}} }}
columns={columns} columns={columns}