Another problem with pagination..

Another problem with pagination..

yankoffyankoff Posts: 6Questions: 0Answers: 0
edited August 2009 in General
When I use full_numbers pagination type, it shows more pages than it should.
E.g. I have 14 entries, so it should be 2 pages, but it shows 3 pages.
On second page it says "Showing 11 to 14 of 14 entries", so it has calculated it correctly, but shows button for third page.

Replies

  • BellardiaBellardia Posts: 2Questions: 0Answers: 0
    I noticed this as well, it seems to only be in the newer versions.

    For the meantime find
    "var iPages = Math.ceil((oSettings.fnRecordsDisplay()-1) / oSettings._iDisplayLength) + 1;"
    and change it to
    "var iPages = Math.ceil((oSettings.fnRecordsDisplay()-1) / oSettings._iDisplayLength);"
  • yankoffyankoff Posts: 6Questions: 0Answers: 0
    Thanks a lot! It helped.
  • johnny2002johnny2002 Posts: 8Questions: 0Answers: 0
    Please note it should be:
    var iPages = Math.ceil(oSettings.fnRecordsDisplay() / oSettings._iDisplayLength);

    Enjoy it.
  • allanallan Posts: 63,516Questions: 1Answers: 10,472 Site admin
    Yeah - a known issue in 1.5.0 - sorry :-(. I'll be releasing a fix soon - until then the fix johnny2002 has posted here is correct (as noted in this thread: http://datatables.net/forums/comments.php?DiscussionID=487&page=1#Item_2 ).

    Regards,
    Allan
This discussion has been closed.