DataTables 1.10.2 and "lengthMenu" option
DataTables 1.10.2 and "lengthMenu" option
ssomenzi
Posts: 2Questions: 1Answers: 0
when I set the lenghtMenu with: "lengthMenu": [ [10, 25, 50, -1], [10, 25, 50, "All"] ] the first 3 options work fine, the last one (-1) does not show all the table rows but the first 10 (as if it was using the "pageLength" option default).
This is my code:
$(document).ready(function() {
$('#example').dataTable( {
"processing": true,
"serverSide": true,
"ajax": "get_all_rows",
"lengthMenu": [ [10, 25, 50, -1], [10, 25, 50, "All"] ]
} );
} );
what am I doing wrong?
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
Does your server-side processing script cope with receiving -1 as the paging length and return all records?
Allan
Dear allan,
that was exactly the problem. Thanks for pointing me in the right direction.
All fine now