Pagination and server-side processing

Pagination and server-side processing

ufrateufrate Posts: 4Questions: 0Answers: 0
edited January 2012 in General
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!

Replies

  • ufrateufrate Posts: 4Questions: 0Answers: 0
    In fact I would like that the paginate button interact with this server-site code:
    [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 !
  • allanallan Posts: 63,540Questions: 1Answers: 10,476 Site admin
    Can you give us a link to your page please?

    Allan
  • ufrateufrate Posts: 4Questions: 0Answers: 0
    I'm sorry, but no, this is part of a dashboard running locally.
  • allanallan Posts: 63,540Questions: 1Answers: 10,476 Site admin
    Okay, but in that case the help I can offer is a bit limited!

    It sounds like you might not be returning iTotalRecords and iTotalDisplayRecords as required: http://datatables.net/usage/server-side

    Allan
  • ufrateufrate Posts: 4Questions: 0Answers: 0
    Aww, thank you a lot!
    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!
This discussion has been closed.