Files
tests/frontend_reactjs/src/components/DataTable.tsx
2024-06-28 12:33:07 +09:00

35 lines
850 B
TypeScript

import { DataGrid } from '@mui/x-data-grid';
interface Props {
rows: any,
columns: any
}
export default function DataTable(props: Props) {
return (
<DataGrid
autoHeight
style={{ width: "100%" }}
rows={props.rows}
columns={props.columns}
initialState={{
pagination: {
paginationModel: { page: 0, pageSize: 10 },
},
}}
pageSizeOptions={[10, 20, 50, 100]}
checkboxSelection
disableRowSelectionOnClick
processRowUpdate={(updatedRow, originalRow) => {
console.log(updatedRow)
return updatedRow
}}
onProcessRowUpdateError={(error)=>{
console.log(error)
}}
/>
);
}