Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Material UI -Data Grid Custom Pagination

I am trying to use the custom pagination from here https://material-ui.com/components/data-grid/style/#custom-theme

however the pagination seems broken itself? Can anyone guide why the pagination is not working and what needs to be done, so that i can implement it?

When I click on page 2, and the click on Page 1, its not working.

like image 621
pradeep ruhil Avatar asked Sep 07 '25 05:09

pradeep ruhil


1 Answers

I had to update the pagination to

    <Pagination
      color="primary"
      showFirstButton
      showLastButton
      page={state.pagination.page + 1}
      count={state.pagination.pageCount}
      // @ts-expect-error
      renderItem={props2 => <PaginationItem {...props2} disableRipple />}
      onChange={(event, value) => apiRef.current.setPage(value-1)}
    />
  )
like image 95
pradeep ruhil Avatar answered Sep 10 '25 00:09

pradeep ruhil