Pagination and server-side processing
Pagination and server-side processing
Hello,
I followed these instruction: http://datatables.net/release-datatables/examples/server_side/server_side.html
But I don't get the pagination (nor inbJQuery mode nor classic). Everything is working fine (search, ordering, ...) but I can't get the pagination.
Is there something I'm missing ?
Here the code:
[code]
$(document).ready(function() {
$('#datatable').dataTable( {
"bJQueryUI" : true,
"bProcessing": true,
"bServerSide": true,
sPaginationType: "full_numbers",
"sAjaxSource": "/returnjson"
} );
} );
[/code]
Thank you!
I followed these instruction: http://datatables.net/release-datatables/examples/server_side/server_side.html
But I don't get the pagination (nor inbJQuery mode nor classic). Everything is working fine (search, ordering, ...) but I can't get the pagination.
Is there something I'm missing ?
Here the code:
[code]
$(document).ready(function() {
$('#datatable').dataTable( {
"bJQueryUI" : true,
"bProcessing": true,
"bServerSide": true,
sPaginationType: "full_numbers",
"sAjaxSource": "/returnjson"
} );
} );
[/code]
Thank you!
This discussion has been closed.
Replies
[code]
/*
* Paging
*/
$sLimit = " LIMIT 100";
if ( isset( $_GET['iDisplayStart'] ) && $_GET['iDisplayLength'] != '-1' )
{
$sLimit = " LIMIT ".mysql_real_escape_string( $_GET['iDisplayStart'] ).", ".
mysql_real_escape_string( $_GET['iDisplayLength'] );
}
[/code]
I tried to add this parameter :
"sPaginationType": "full_numbers",
But this is changing nothing neither in bJQueryUI nor without.
I also tried to att this paramater:
"sDom": '<"top"i>rt<"bottom"flp><"clear">' but this is not working
Thanks for your help !
Allan
It sounds like you might not be returning iTotalRecords and iTotalDisplayRecords as required: http://datatables.net/usage/server-side
Allan
Yes, iTotalDisplayRecords was not set as it need.
I suggest you to update the example here : http://datatables.net/release-datatables/examples/data_sources/server_side.html
"iTotalRecords": "57",
"iTotalDisplayRecords": "57",
By putting differents value for iTotalRecords and iTotalDisplayRecords so we can understand easily the difference between the two (even if the PHP example is very clear).
Thanks again and long life to DataTables!