CFE-5 fixed bug in datatable

This commit is contained in:
AmirHossein Mahmoodi
2023-10-21 15:51:57 +03:30
parent 74e9c53baf
commit 416fffd93a
18 changed files with 42 additions and 50 deletions

View File

@@ -121,7 +121,7 @@ function DataTable(props) {
}}
enableColumnFilterModes
muiTablePaperProps={{elevation: 0}}
rowCount={data?.meta.totalRowCount}
rowCount={data?.meta?.totalRowCount ?? 0}
onColumnFilterFnsChange={setColumnFilterFns}
onColumnFiltersChange={setColumnFilters}
onPaginationChange={setPagination}
@@ -130,7 +130,7 @@ function DataTable(props) {
renderTopToolbarCustomActions={({table}) => (
<>
{props.enableCustomToolbar /* send condition */
? <props.CustomToolbar fetchUrl={fetchUrl} mutate={mutate}/> /* send component */
? <props.CustomToolbar mutate={mutate}/> /* send component */
: "<span></span>"}
</>
)}
@@ -163,7 +163,7 @@ function DataTable(props) {
}}
positionActionsColumn={"last"}
enableRowActions={props.enableRowActions}
renderRowActions={({row}) => <props.TableRowAction fetchUrl={fetchUrl} mutate={mutate} row={row}/>}
renderRowActions={({row}) => <props.TableRowAction mutate={mutate} row={row}/>}
{...props}
/>
);