Topic: [Feature request] Datatable server side processing
Datatables should support server-side processing like https://datatables.net/manual/server-side
Or, at least, provide these events
onPageChange
onSearch
onPerPageChange
onSort
Aliaksandr Andrasiuk staff answered 5 years ago
Hi,
We will analyze your suggestions and work on this in the near future.
onPageChange
, onSearch
, onPerPageChange
, onSort
it's a good proposal which probably will be implemented.
Thank you for the response!
Best regards.
Roman Mzh pro premium priority commented 5 years ago
Did the near future come? :)
Konrad Stępień staff commented 5 years ago
Hi @Roman Mzh,
Yes, we added these methods and it waiting for next release :)
Best regards, Konrad.
Roman Mzh pro premium priority commented 5 years ago
Hello @Konrad Stępień
Thx for adding a new methods! But how about onPerPageChange
Konrad Stępień staff commented 5 years ago
Hello @Roman Mzh,
if you print onPageChange
like this
<MDBDataTable
striped
bordered
hover
entriesOptions={[5, 20, 25]}
entries={5}
pagesAmount={4}
data={new data()}
onPageChange={e=>console.log(e)}
/>
This method returns data like this: {activePage: 1, pagesAmount: 12}
Just we connect two methods for one.
Please check it and tell me if this is good for you.
Best regards, Konrad.
Roman Mzh pro premium priority commented 5 years ago
No, it doesn't fire when I switch from 5 entries per page to for example 25.
Let's say I have 20000+ field. Loading them all is resource consuming, so I just want to get a response like
{ data: [array with N elements for current page], totalFields: 20000, currentPage: 1 }
Using this data, I can fill 20000 - N fake records to make pagination and total records counter work :) So, when N is changed, I need to request a new data.
Roman Mzh pro premium priority answered 5 years ago
bump
onPerPageChange
is very wanted
Konrad Stępień staff commented 5 years ago
Hi @Roman Mzh,
We will try to add it in this or next release.
Best regards, Konrad.
Prasang Misra answered 4 years ago
When is your next release?
Magdalena Dembna staff premium commented 4 years ago
The next release date isn't settled yet - but regarding this topic, there was a new version of Data Table released in May - does the problem of onPageChange
still occur in the MDBDataTableV5
component? Best regards, Magdalena
Paul TP commented 4 years ago
@Piotr Glejzer and @Magdalena Dembna I am trying to implement server side pagination using the onPageChange and it works fine but the active page or current page does not change, it's always 1. Is there a way to update it?
Simic answered 4 years ago
Where can I find documentation for onPageChange, onSearch, onPerPageChange, onSort? Best regards, Selena
Piotr Glejzer staff commented 4 years ago
Check here https://mdbootstrap.com/docs/react/tables/datatables/#docsTabsAPI
FREE CONSULTATION
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
Answered
- User: Pro
- Premium support: Yes
- Technology: MDB React
- MDB Version: 4.18.0
- Device: pc
- Browser: chrome
- OS: ubuntu 18.04
- Provided sample code: No
- Provided link: Yes