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.
*Resources (screenshots, code snippets etc.)
Mateusz Łubianka staff answered 5 years ago
You can use the pageLength option. Try this code:
$(document).ready(function () {
$('#dtBasicExample').DataTable({
"pageLength": 50
});
$('.dataTables_length').addClass('bs-select');
});
Best,
FREE CONSULTATION
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
Answered
- User: Free
- Premium support: No
- Technology: General Bootstrap questions
- MDB Version: -
- Device: computer
- Browser: safari
- OS: osx
- Provided sample code: No
- Provided link: No