iDisplayLength with Server side processing?

iDisplayLength with Server side processing?

darthvandarthvan Posts: 9Questions: 0Answers: 0
edited June 2010 in General
Hello,when put that iDisplayLength = 10 ,it works fine when bServerSide = false,but when it is true,it display all records on one page even if iDisplayLength = 10.How to solve this?Tnx

Replies

  • JasonDJasonD Posts: 4Questions: 0Answers: 0
    If you are using server-side processing then you will need to handle pagination, sorting, etc in your server-side code. For example, I do this in PHP:

    [code]
    for ( $row = 0; $row < $numsplf; $row++) {
    if (($row < ( $iDisplayStart + $iDisplayLength )) && ($row >= $iDisplayStart ) ) {
    /* build aaData here */
    }
    }
    [/code]
  • darthvandarthvan Posts: 9Questions: 0Answers: 0
    Ok,I look at this example,http://datatables.net/examples/data_sources/server_side.html and still not understand how paging work.Can you post your bigger example,or exaplain how paging work.Sorry,I'm newbie.Tnx
  • codingavenuecodingavenue Posts: 22Questions: 0Answers: 0
    Hi darthvan,

    I believe just by following the code on the link that you just posted should work. DataTables will do the pagination for you as long as you give it the necessary information it needs.

    Could you post your server side code?

    codingavenue
  • darthvandarthvan Posts: 9Questions: 0Answers: 0
    Sorry,I just try to understand how that works.
This discussion has been closed.