no scrolling on table
This commit is contained in:
@@ -158,7 +158,7 @@ export default function EnhancedTable({
|
|||||||
}, [config, onDelete, navigate, onNavigateToResource]);
|
}, [config, onDelete, navigate, onNavigateToResource]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Box sx={{ height: 600, width: '100%' }}>
|
<Box sx={{ width: '100%' }}>
|
||||||
<Box sx={{ display: 'flex', justifyContent: 'space-between', mb: 3, alignItems: 'center' }}>
|
<Box sx={{ display: 'flex', justifyContent: 'space-between', mb: 3, alignItems: 'center' }}>
|
||||||
<Typography variant="h5">{config.pluralLabel}</Typography>
|
<Typography variant="h5">{config.pluralLabel}</Typography>
|
||||||
<Button variant="contained" color="primary" onClick={onCreate}>
|
<Button variant="contained" color="primary" onClick={onCreate}>
|
||||||
@@ -168,6 +168,7 @@ export default function EnhancedTable({
|
|||||||
<DataGrid
|
<DataGrid
|
||||||
rows={data || []}
|
rows={data || []}
|
||||||
columns={columns}
|
columns={columns}
|
||||||
|
autoHeight
|
||||||
getRowId={(row) => {
|
getRowId={(row) => {
|
||||||
const pk = config.primaryKey;
|
const pk = config.primaryKey;
|
||||||
if (row[pk] !== undefined && row[pk] !== null) return row[pk];
|
if (row[pk] !== undefined && row[pk] !== null) return row[pk];
|
||||||
@@ -183,7 +184,7 @@ export default function EnhancedTable({
|
|||||||
paginationModel: { page: 0, pageSize: 10 },
|
paginationModel: { page: 0, pageSize: 10 },
|
||||||
},
|
},
|
||||||
}}
|
}}
|
||||||
pageSizeOptions={[5, 10, 25]}
|
pageSizeOptions={[10, 25, 50]}
|
||||||
/>
|
/>
|
||||||
</Box>
|
</Box>
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user