Changing default datatable pagination entries


Topic: Changing default datatable pagination entries

yorkmyers pro premium priority asked 2 years ago

Can you please share how I can change the default number of rows that appear in a simple datatable?

I'm able to get the table to appear just by adding the CSS class. Couldn't find additional HTML-data attributes or JavaScript to use though.

Example: https://mdbootstrap.com/snippets/standard/yorkmyers/5139203


kpienkowska staff answered 2 years ago

You can change the default number of pagination with data attribute entries.

Example: https://mdbootstrap.com/snippets/standard/kpienkowska/5144756

But if you want to use value different than 10, 25, 50 or 100 you also need to add a new option using the entriesOptions attribute. But since it accepts arrays as arguments it needs to be done with JS.


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: Pro
  • Premium support: Yes
  • Technology: MDB Standard
  • MDB Version: MDB5 5.0.0
  • Device: Desktop
  • Browser: Chrome
  • OS: Windows
  • Provided sample code: No
  • Provided link: Yes
Tags