|
|
@@ -11,7 +11,7 @@ import { TablePagination, Typography } from '@mui/material'; |
|
|
|
|
|
|
|
export function FiDataGrid({ rows, columns, sx, autoHeight, |
|
|
|
hideFooterSelectedRowCount, rowModesModel, editMode, |
|
|
|
pageSizeOptions, filterItems, customPageSize, doLoad, onGridReady, ...props }) { |
|
|
|
pageSizeOptions, filterItems, customPageSize, doLoad, ...props }) { |
|
|
|
const intl = useIntl(); |
|
|
|
const [_rows, set_rows] = useState([]); |
|
|
|
const [_doLoad, set_doLoad] = useState({}); |
|
|
@@ -56,12 +56,6 @@ export function FiDataGrid({ rows, columns, sx, autoHeight, |
|
|
|
setLoading(true) |
|
|
|
}, [doLoad]); |
|
|
|
|
|
|
|
useEffect(() => { |
|
|
|
setPage(0); |
|
|
|
set_doLoad(doLoad); |
|
|
|
setLoading(true) |
|
|
|
}, [onGridReady]); |
|
|
|
|
|
|
|
useEffect(() => { |
|
|
|
getDataList(); |
|
|
|
}, [_doLoad, page]); |
|
|
@@ -122,7 +116,12 @@ export function FiDataGrid({ rows, columns, sx, autoHeight, |
|
|
|
|
|
|
|
|
|
|
|
function getDataList() { |
|
|
|
// console.log(Object.keys(_doLoad.params).length > 0) |
|
|
|
// console.log(Object.keys(_doLoad.params).length > 0) |
|
|
|
|
|
|
|
if (_doLoad?.url == null) return; |
|
|
|
if (_doLoad.params == undefined) return; |
|
|
|
if (_doLoad.params.searchCriteria !== undefined) return; |
|
|
|
if (_doLoad.params == null) _doLoad.params = {}; |
|
|
|
_doLoad.params.start = page * pageSize; |
|
|
|
_doLoad.params.limit = pageSize; |
|
|
|