Basic data table change page size default


Topic: Basic data table change page size default

emichaud@gmail.com asked 5 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 5 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
  • User: Free
  • Premium support: No
  • Technology: General Bootstrap questions
  • MDB Version: -
  • Device: computer
  • Browser: safari
  • OS: osx
  • Provided sample code: No
  • Provided link: No