DataTable: data from server including pagining


Topic: DataTable: data from server including pagining

vikramjeet sra asked 3 years ago

Expected behavior

server side data for data table, render limited data on UI when clicking on next page call API and get more data. following is meta data.

"pagination": { "total": x, "count": x, "per_page": x, "current_page": x, "total_pages": x, "links": [] }

Actual behavior

Currently DataTable needs all the record at a time, which is not feasible solution incase of large number for record .

Resources (screenshots, code snippets etc.)

There is issue already raised earlier, still not resolved. Can you please provide example if this is possible https://mdbootstrap.com/support/vue/how-top-make-server-side-datatable/


Marcin Luczak staff answered 3 years ago

Hi,

Unfortunately, there is no dedicated solution for this kind of functionality but you can make a good try combining asynchronous data calls with a render event on the Datatable component that calls every time the component is loaded or the page is changed. With this, you could try to keep internal info about the current amount of pages/data rendered and e.g. asynchronously call more data every second, third, etc... render event is called. I hope this will bring you closer to what you want to achieve.

Keep coding, Marcin


vikramjeet sra commented 3 years ago

Thanks for your response, I have created custom solution using MDBDatatable(without pagination) and MDBPagination component.


Marcin Luczak staff commented 3 years ago

That's great :) Your custom solution idea will definitely help others with similar issues.

Keep coding, Marcin


Please insert min. 20 characters.

FREE CONSULTATION

Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.

Status

Answered

Specification of the issue
  • User: Free
  • Premium support: No
  • Technology: MDB Vue
  • MDB Version: MDB5 1.0.0
  • Device: Desktop
  • Browser: Chrome
  • OS: Windows
  • Provided sample code: No
  • Provided link: Yes