How to set custom starting page number for MDBDataTable in React

1k Views Asked by At

I have a pagination problem. MDBDataTable jumps back to first page upon data edit. Looks like, it's a bug. So, I decided to set the current page number in order to keep the current page.

<MDBDataTable
            data-testid='datatable'
            small
            responsive
            hover
            noBottomColumns 
            data={props.data}
            paginationLabel={['Prev', 'Next']}
            info={false} 
        />

Couldn't find the documentation for attribute list. Is there any attribute to set starting page, or any other solution?

1

There are 1 best solutions below

0
Tebe On

Try setting property disableRetreatAfterSorting={true}

I solves the problem with resetting the page. So no need to track and modify it manually

Solution was found from discussion here here