DataTables 1.10.2 and "lengthMenu" option
DataTables 1.10.2 and "lengthMenu" option
![ssomenzi](https://secure.gravatar.com/avatar/3f43540c7af61d606cc9d6c09b660a5a/?default=https%3A%2F%2Fvanillicon.com%2F3f43540c7af61d606cc9d6c09b660a5a_200.png&rating=g&size=120)
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