Topic: Basic data table change page size default

emichaudgmail-com free asked 4 years ago


Expected behavior set the default number of entries for the drop down that says "Show [dropdown selector] entries". I'd like to be able to set this to a different number as the default.

Actual behavior defaults to first entry of 10.

enter image description here *Resources (screenshots, code snippets etc.)


Mateusz Łubianka staff answered 4 years ago


Hi @emichaud@gmail.com,

You can use the pageLength option. Try this code:

$(document).ready(function () {
      $('#dtBasicExample').DataTable({
        "pageLength": 50
      });
      $('.dataTables_length').addClass('bs-select');
    });

Best,



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

  • ForumUser: Free
  • Premium support: No
  • Technology: General Bootstrap questions
  • MDB Version: -
  • Device: computer
  • Browser: safari
  • OS: osx
  • Provided sample code: No
  • Provided link: No
Tags