comment out the tabe to see if it is the issue
This commit is contained in:
parent
407a8fc8c1
commit
02c7196751
1 changed files with 14 additions and 15 deletions
|
|
@ -17,16 +17,14 @@ interface Props {
|
|||
|
||||
export default function TransactionViewer(props: Props) {
|
||||
const { transactions, loading, objectNames } = props;
|
||||
const [displayedRows, setDisplayedRows] = useState<Transaction[]>([Transaction.create()])
|
||||
const [displayedRows, setDisplayedRows] = useState<Transaction[]>([])
|
||||
const [tablePage, setTablePage] = useState(0)
|
||||
const [pageSize, setPageSize] = useState(10)
|
||||
|
||||
useEffect(()=>{
|
||||
let clone: Transaction[] = cloneDeep(transactions)
|
||||
let rows = clone.splice(tablePage * pageSize, pageSize)
|
||||
if (rows.length !== 0){
|
||||
setDisplayedRows(rows)
|
||||
}
|
||||
setDisplayedRows(rows)
|
||||
},[transactions, tablePage, pageSize])
|
||||
|
||||
const columns: Column<Transaction>[] = [
|
||||
|
|
@ -86,17 +84,18 @@ export default function TransactionViewer(props: Props) {
|
|||
console.log("transactionViewer: " + displayedRows)
|
||||
//console.log(transactions)
|
||||
return (
|
||||
<ResponsiveTable<Transaction>
|
||||
isLoading={loading}
|
||||
title={"Inventory Transactions"}
|
||||
page={tablePage}
|
||||
columns={columns}
|
||||
pageSize={pageSize}
|
||||
rows={displayedRows}
|
||||
total={transactions.length}
|
||||
setPage={page => setTablePage(page)}
|
||||
handleRowsPerPageChange={handleChange}
|
||||
/>
|
||||
// <ResponsiveTable<Transaction>
|
||||
// isLoading={loading}
|
||||
// title={"Inventory Transactions"}
|
||||
// page={tablePage}
|
||||
// columns={columns}
|
||||
// pageSize={pageSize}
|
||||
// rows={displayedRows}
|
||||
// total={transactions.length}
|
||||
// setPage={page => setTablePage(page)}
|
||||
// handleRowsPerPageChange={handleChange}
|
||||
// />
|
||||
null
|
||||
)
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue