DataTables allows you to change the options in the dropdown menu for number of records shown per page: https://datatables.net/reference/option/lengthMenu
However, if you define it as per the example:
"lengthMenu": [ 10, 25, 50, 75, 100 ]
You will get a default option of 10, because this appears first in the array.
What if you want to use something else (e.g. 50 or 75) as the default option? I can't see any method on their documentation that allows this. I understand you could use jquery to target by element value, but that seems like a terrible idea.
Can you try this ? :)
$('#example').dataTable( {
"pageLength": 50
} );
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With