Paging table incorrect with Serverside processing

Paging table incorrect with Serverside processing

ureshdesureshdes Posts: 5Questions: 0Answers: 0
edited August 2010 in Bug reports
When server-side processing is enabled, the paging table end value is not correct when the displayed number of rows are less than the display length.

Eg: Paging is set to 10 per page and total is 209. The last page only has 9 records but the paging table displays the following. (the end value is defaulted to start + displayLength)
Showing 201 to 210 of 209 entries

Replies

  • allanallan Posts: 61,452Questions: 1Answers: 10,055 Site admin
    Looks okay in this example: http://datatables.net/examples/server_side/server_side.html : "Showing 51 to 57 of 57 entries". Are you sending back the required parameters for the display length properties? It would be worth using Firebug to look at the server return in the example.

    Allan
  • ureshdesureshdes Posts: 5Questions: 0Answers: 0
    I think I am setting the correct values back. One thing I noticed is, _fnCalculateEnd is getting called twice and the 2nd time, oSettings.aiDisplay.length is 0, which results in oSettings._iDisplayEnd = oSettings._iDisplayStart + oSettings._iDisplayLength; to get executed, which makes the results appear as I see.

    One more thing which is inline with the above explanation, I have "aLengthMenu": [[10, 25, 50, -1], [10, 25, 50, "All"]] and when I select All, I see the following;
    Showing 1 to -1 of 209 entries
  • allanallan Posts: 61,452Questions: 1Answers: 10,055 Site admin
    This is unfortunately a known issue with 1.7.0: http://datatables.net/forums/comments.php?DiscussionID=2440&page=1#Item_2 (fix included). This will be addressed in the next release :-)

    Allan
  • ureshdesureshdes Posts: 5Questions: 0Answers: 0
    Thanks, the temp fix worked for the -1 issue. Also, I found out what was causing the 'Showing 201 to 210 of 209 entries' issue I was referring to in the above example, I was trying to pass in a 2D aaData array to match the indexes as scene on the page (based on the page and show results values).

    It's all fine now. As always, thanks for the help !
This discussion has been closed.