[SOLVED] server-side processing: paging does not work

[SOLVED] server-side processing: paging does not work

pktmpktm Posts: 27Questions: 0Answers: 0
edited December 2009 in General
Dear all!

I use server-side processing and paging. Unfortunately, I don't get the pagination to work. The table assumes only one page, but there is more. The pagination buttons are both grey and the request issued contains iDisplayStart=0.

Here is the javascript code:
[code]
$(document).ready(function() {
$('#example').dataTable( {
"bProcessing": true,
"bServerSide": true,
"sAjaxSource": "run.cgi?rm=table_data",
} );
} );
[/code]

And here is the data returned by the script (copied from firebug):
[code]
{"aaData":[["004","AFGHANISTAN","AF","AFG"],["008","ALBANIA","AL","ALB"],["010","ANTARCTICA","AQ","ATA"],["012","ALGERIA","DZ","DZA"],["016","AMERICAN SAMOA","AS","ASM"],["020","ANDORRA","AD","AND"],["024","ANGOLA","AO","AGO"],["028","ANTIGUA AND BARBUDA","AG","ATG"],["031","AZERBAIJAN","AZ","AZE"],["032","ARGENTINA","AR","ARG"]],"iTotalDisplayRecords":10,"iTotalRecords":"240","sEcho":1}
[/code]

So what did I miss? What do I need to check / set to get the pagination to work?

Best regards, Alex

Replies

  • pktmpktm Posts: 27Questions: 0Answers: 0
    Never mind, I confused iTotalDisplayRecords with the number of rows actually displayed. But it is the number of columns found without the LIMIT clause of the query.
This discussion has been closed.