How to do Server Side Pagination/Sort/Search using MDBDataTable in React JS

Viewed 383

I'm using MDBDataTable in React JS. I want to do Server Side Pagination/Sort etc. But I didn't find any way of doing it.

Below is my sample code which I am using.

<MDBDataTable
      striped
      bordered
      hover
      entriesOptions={[10, 20, 50]}
      entries={10}
      pagesAmount={prop.data.totalPages}
      data={prop.data}
      paging={true}
      onSearch={(value) => console.log(value)}
      onPageChange={(e) => console.log(e)}
      onSort={(value) => console.log(value)}
    />

In the above code, {prop.data} has 10 records, and MDBDataTable shows 10 records with 1 page only but we have a total of 102 records, I didn't find a way to tell MDBDataTable about the total no. of records that can help us to show other pages to navigate.

Can someone please help me with how we can do server-side integration in MDBDataTable?

0 Answers
Related