|
|
@@ -10,7 +10,7 @@ import {TablePagination, Typography} from '@mui/material'; |
|
|
|
|
|
|
|
export function FiDataGrid({ rows, columns, sx, autoHeight, |
|
|
|
hideFooterSelectedRowCount, rowModesModel, editMode, |
|
|
|
pageSizeOptions, filterItems, ...props }) { |
|
|
|
pageSizeOptions, filterItems, customPageSize, ...props }) { |
|
|
|
const intl = useIntl(); |
|
|
|
const [_rows, set_rows] = React.useState([]); |
|
|
|
const [_columns, set_columns] = React.useState([]); |
|
|
@@ -64,7 +64,11 @@ export function FiDataGrid({ rows, columns, sx, autoHeight, |
|
|
|
if(filterItems){ |
|
|
|
set_filterItems(filterItems); |
|
|
|
} |
|
|
|
}, [sx, hideFooterSelectedRowCount, rowModesModel, rows, columns, pageSizeOptions, autoHeight, editMode, filterItems]); |
|
|
|
|
|
|
|
if(customPageSize){ |
|
|
|
setPageSize(customPageSize); |
|
|
|
} |
|
|
|
}, [sx, hideFooterSelectedRowCount, rowModesModel, rows, columns, pageSizeOptions, autoHeight, editMode, filterItems, customPageSize]); |
|
|
|
|
|
|
|
const handleChangePage = (event, newPage) => { |
|
|
|
setPage(newPage); |
|
|
@@ -109,7 +113,7 @@ export function FiDataGrid({ rows, columns, sx, autoHeight, |
|
|
|
count={_rows.length} |
|
|
|
page={page} |
|
|
|
rowsPerPage={pageSize} |
|
|
|
rowsPerPageOptions={[5,10,15]} |
|
|
|
rowsPerPageOptions={[5,10,15,20,100]} |
|
|
|
labelDisplayedRows={({ from, to, count }) => |
|
|
|
`${from}-${to} ${intl.formatMessage({ id: "of" })} ${count}` |
|
|
|
} |
|
|
|