Error with Pagination when setting iDisplayLength

Error with Pagination when setting iDisplayLength

fasted004fasted004 Posts: 3Questions: 0Answers: 0
edited February 2011 in Bug reports
I am using server side processing and running into a problem when I try to specify iDisplayLength...

assuming iDisplayLength=25
using the 2 button paging system the initial request for the first 25 entries works as expected...
The entries returned are 1 to 25
The info says: "Showing 1 to 25 of 23,468 entries"

however clicking the next button results in the following...
The entries returned are 25 to 50
The info says: "Showing 0251 to 2,525 of 23,468 entries"

clicking next one more time...
The entries returned are 2525 to 2550
The info says: "Showing 025,251 to 23,468 of 23,468"

Because my number of entries is 23,468 the next button is now disabled

So it appears that the range info is not getting updated properly, and from what I have read on the server-side processing it appears that the javascript handles this and the developer does not have to control it.

Other potentially useful information

- pagination works fine when iDisplayLength is not specified in the javascript
- pagination works fine if the user changes the display length using the drop down menu
- pagination even works fine if the user first selects a different page length, then returns the page length to 25


Loving DataTables it is clean and simple thanks for all the great work.

Replies

  • fasted004fasted004 Posts: 3Questions: 0Answers: 0
    edited February 2011
    Nevermind fixed my own issue with by browsing non-pagination iDisplayLength questions

    i was using "iDisplayLength": "25"

    just removed the quotes

    "iDisplayLength": 25
  • icemovericemover Posts: 5Questions: 0Answers: 0
    I made the same mistake, so perhaps a filter, or an error message would be in order?
  • allanallan Posts: 63,389Questions: 1Answers: 10,449 Site admin
    What I've wanted to do for while a long time now is have a debug version of DataTables which would perform type checks such as this, and they would be stripped out from the production version to lighten the code base and speed things up (that is why tests such as this aren't in the core at the moment). It's just a case of getting a chance to do it! But yes - a good idea for certain :-)

    Allan
  • fbasfbas Posts: 1,094Questions: 4Answers: 0
    ParseInt or IsNumeric won't bloat the code much, for initialization-time variables.
This discussion has been closed.