trying taking out the hidePagination
This commit is contained in:
parent
9d3cd41d5f
commit
b835524700
3 changed files with 14 additions and 18 deletions
|
|
@ -66,11 +66,11 @@ export default function CableMounting(props: Props) {
|
|||
rows={bin.CableSums}
|
||||
columns={columns}
|
||||
page={0}
|
||||
pageSize={0}
|
||||
pageSize={5}
|
||||
handleRowsPerPageChange={()=>{}}
|
||||
setPage={()=>{}}
|
||||
total={0}
|
||||
hidePagination
|
||||
//hidePagination
|
||||
/>
|
||||
)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -133,11 +133,11 @@ export default function CableTable(props: Props) {
|
|||
columns={columns}
|
||||
rows={cableData}
|
||||
page={0}
|
||||
pageSize={0}
|
||||
pageSize={5}
|
||||
total={0}
|
||||
setPage={()=>{}}
|
||||
handleRowsPerPageChange={()=>{}}
|
||||
hidePagination
|
||||
//hidePagination
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -91,7 +91,7 @@ interface Props<T> {
|
|||
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<T extends Object>(props: Props<T>) {
|
||||
|
|
@ -120,7 +120,7 @@ export default function ResponsiveTable<T extends Object>(props: Props<T>) {
|
|||
selectedRows,
|
||||
customElement,
|
||||
mobileView,
|
||||
hidePagination
|
||||
//hidePagination
|
||||
} = props
|
||||
const classes = useStyles();
|
||||
const columns = typeof(props.columns) === "function" ? props.columns() : props.columns
|
||||
|
|
@ -141,10 +141,6 @@ export default function ResponsiveTable<T extends Object>(props: Props<T>) {
|
|||
return saved ? JSON.parse(saved) : [];
|
||||
});
|
||||
|
||||
useEffect(()=>{
|
||||
console.log("ResponsiveTable rows: " + rows.toString())
|
||||
},[rows])
|
||||
|
||||
useEffect(() => {
|
||||
localStorage.setItem(filterKey, JSON.stringify(filterList));
|
||||
}, [filterList])
|
||||
|
|
@ -353,7 +349,7 @@ export default function ResponsiveTable<T extends Object>(props: Props<T>) {
|
|||
</Card>
|
||||
)
|
||||
})}
|
||||
{/* {rows.length < 1 &&
|
||||
{rows.length < 1 &&
|
||||
(!isLoading ?
|
||||
<Typography sx={{ textAlign: "center" }} color="textSecondary">
|
||||
{ noDataMessage ? noDataMessage : "No data."}
|
||||
|
|
@ -363,7 +359,7 @@ export default function ResponsiveTable<T extends Object>(props: Props<T>) {
|
|||
<CircularProgress/>
|
||||
</Box>
|
||||
)
|
||||
} */}
|
||||
}
|
||||
</Box>
|
||||
)
|
||||
|
||||
|
|
@ -427,7 +423,7 @@ export default function ResponsiveTable<T extends Object>(props: Props<T>) {
|
|||
<TableRow sx={ hideKeys ? { display: "none" } : undefined } >
|
||||
{ rowSelect && <TableCell></TableCell> }
|
||||
{ renderGutter && <TableCell></TableCell>}
|
||||
{/* { columns ?
|
||||
{ columns ?
|
||||
columns.map((column, index) => {
|
||||
if (filterList.includes(column.title) || column.hidden) return null
|
||||
return (
|
||||
|
|
@ -444,7 +440,7 @@ export default function ResponsiveTable<T extends Object>(props: Props<T>) {
|
|||
</TableCell>
|
||||
)
|
||||
})
|
||||
} */}
|
||||
}
|
||||
</TableRow>
|
||||
</TableHead>
|
||||
<TableBody>
|
||||
|
|
@ -522,7 +518,7 @@ export default function ResponsiveTable<T extends Object>(props: Props<T>) {
|
|||
)
|
||||
})
|
||||
}
|
||||
{/* {rows.length < 1 && !isLoading &&
|
||||
{rows.length < 1 && !isLoading &&
|
||||
<TableRow>
|
||||
<TableCell colSpan={6} sx={{textAlign: "center" }}>
|
||||
<Typography variant="body2" color="textSecondary">
|
||||
|
|
@ -530,10 +526,10 @@ export default function ResponsiveTable<T extends Object>(props: Props<T>) {
|
|||
</Typography>
|
||||
</TableCell>
|
||||
</TableRow>
|
||||
} */}
|
||||
}
|
||||
</TableBody>
|
||||
</Table>
|
||||
{!hidePagination &&
|
||||
{/* {!hidePagination && */}
|
||||
<TablePagination
|
||||
rowsPerPageOptions={rowsPerPageOptions ? rowsPerPageOptions : [5, 10, 20]}
|
||||
component="div"
|
||||
|
|
@ -543,7 +539,7 @@ export default function ResponsiveTable<T extends Object>(props: Props<T>) {
|
|||
onPageChange={(_event, page) => handlePageChange(page)}
|
||||
onRowsPerPageChange={handleRowsPerPageChange}
|
||||
/>
|
||||
}
|
||||
{/* } */}
|
||||
<Menu
|
||||
id="userMenu"
|
||||
anchorEl={columnAnchor}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue