Server-side data, use length menu and show "All" with -1 ?
Server-side data, use length menu and show "All" with -1 ?
In the length menu example, we see the options set as follows:
http://www.datatables.net/examples/advanced_init/length_menu.html
[code]
$('#example').dataTable( {
"aLengthMenu": [[10, 25, 50, -1], [10, 25, 50, "All"]]
} );
[/code]
Yet when I try this approach server-side, it fails when selecting "All".
Has anyone run across this issue before or familiar with
how to handle this scenario?
http://www.datatables.net/examples/advanced_init/length_menu.html
[code]
$('#example').dataTable( {
"aLengthMenu": [[10, 25, 50, -1], [10, 25, 50, "All"]]
} );
[/code]
Yet when I try this approach server-side, it fails when selecting "All".
Has anyone run across this issue before or familiar with
how to handle this scenario?
This discussion has been closed.
Replies
'All' is a special case - what happens with all is (as the array above says) it will use -1 as the length to get, rather than a positive integer. As such the server-side script needs to take this into account. The default server-side processing script already does this with the line:
[code]
if ( isset( $_GET['iDisplayStart'] ) && $_GET['iDisplayLength'] != '-1' )
[/code]
This is the default script: http://www.datatables.net/development/server-side/php_mysql .
Are you using that script or a different one? If a different one it will need to take the -1 into account.
Regards,
Allan
This is satish i have problem with id numbers after deleting a row.Can Anyone help how to change id after delete of table
Have a look through this post and open a new thread with your question: http://datatables.net/forums/discussion/9719/how-to-ask-for-help .
Allan