diff --git a/src/cableEstimator/cableMounting.tsx b/src/cableEstimator/cableMounting.tsx index 4ea84e7..e4913fc 100644 --- a/src/cableEstimator/cableMounting.tsx +++ b/src/cableEstimator/cableMounting.tsx @@ -66,11 +66,11 @@ export default function CableMounting(props: Props) { rows={bin.CableSums} columns={columns} page={0} - pageSize={5} + pageSize={0} handleRowsPerPageChange={()=>{}} setPage={()=>{}} total={0} - //hidePagination + hidePagination /> ) } diff --git a/src/cableEstimator/cableTable.tsx b/src/cableEstimator/cableTable.tsx index 51f4473..a0913e5 100644 --- a/src/cableEstimator/cableTable.tsx +++ b/src/cableEstimator/cableTable.tsx @@ -133,11 +133,11 @@ export default function CableTable(props: Props) { columns={columns} rows={cableData} page={0} - pageSize={5} + pageSize={0} total={0} setPage={()=>{}} handleRowsPerPageChange={()=>{}} - //hidePagination + hidePagination /> ); } diff --git a/src/common/ResponsiveTable.tsx b/src/common/ResponsiveTable.tsx index 9d39ff8..d2f10d2 100644 --- a/src/common/ResponsiveTable.tsx +++ b/src/common/ResponsiveTable.tsx @@ -91,7 +91,7 @@ interface Props { selectedRows?: number[]; //which rows are selected will need to be controlled by the parent in order to keep track between page changes customElement?: JSX.Element //element that will be placed in the table head between the table actions and the column header rows mobileView?: boolean //can be used to force the table to use its mobile view for narrow containing elements ie, drawer - //hidePagination?: boolean //when passed in will hide the pagination at the bottom of the table + hidePagination?: boolean //when passed in will hide the pagination at the bottom of the table } export default function ResponsiveTable(props: Props) { @@ -120,7 +120,7 @@ export default function ResponsiveTable(props: Props) { selectedRows, customElement, mobileView, - //hidePagination + hidePagination } = props const classes = useStyles(); const columns = typeof(props.columns) === "function" ? props.columns() : props.columns @@ -529,7 +529,7 @@ export default function ResponsiveTable(props: Props) { } - {/* {!hidePagination && */} + {!hidePagination && (props: Props) { onPageChange={(_event, page) => handlePageChange(page)} onRowsPerPageChange={handleRowsPerPageChange} /> - {/* } */} + } ([]) + const [displayedRows, setDisplayedRows] = useState([Transaction.create()]) const [tablePage, setTablePage] = useState(0) const [pageSize, setPageSize] = useState(10) useEffect(()=>{ let clone: Transaction[] = cloneDeep(transactions) let rows = clone.splice(tablePage * pageSize, pageSize) - setDisplayedRows(rows) + if (rows.length !== 0){ + setDisplayedRows(rows) + } },[transactions, tablePage, pageSize]) const columns: Column[] = [