Paging on last page with full numbers - correct behaviour?

Paging on last page with full numbers - correct behaviour?

rodrigo_rodrigo_ Posts: 2Questions: 0Answers: 0
edited September 2011 in General
Hi,

I've found an unexpected behavior (at least for me) that is probably a bug on paging.

First of all I populated the ajax table with sequential records from 1 to 966 so it's more easy to note paging issues.
Then I added a new example file (bug_pipeline.html) that is a copy of pipeline.html but the only change I made is:

[code]"sPaginationType": "full_numbers",[/code]

After that I ran the example on http://brainotics.net/datatables/examples/server_side/big_pipeline.html; the steps to reproduce it are:
1) Move to the last page using the last button. You will see entries from 961 to 966 and that's perfect.
2) Now change the dropdown for DisplayLength. By default is on 10, select 100 entries. That will show you entries from 867 to 966. The expected behavior is to display entries from 901 to 966 on the last page (page 10) because:
[code]
Page # Entries (From - To)
--------------------------------
1 1-100
2 101-200
3 201-300
4 301-400
5 401-500
6 501-600
7 601-700
8 701-800
9 801-900
10 (last) 901-966
[/code]

I think and expect that if you change the page size you should get the number of results for that page, that's the way all the paging i've seen works. What is weird for me and disconcerting for the user is that today is possible to see different results on the same page depending on the way you arrive to it, if you navigate to it by clicking next it will show you the only the remaining results but in the case I described to you it will show the last 100 records (for example).

Have any of you experienced the same problem? What do you think about this?

I'll be waiting for your comments.

Regards,
Rodrigo

PS: I've fixed it, so if anyone is interested I can post the solution here.

Replies

  • allanallan Posts: 63,542Questions: 1Answers: 10,476 Site admin
    Hi Rodrigo,

    Thanks very much for posing this question - its a good one! I've pinned this discussion to the top of the forum for the moment, and hopefully a a few others will be able to provide their insights into this. I've also modified the title slightly since its not a bug at the moment, since it is working as designed, but the design might have been in error...

    The reason I did it this way originally was if you got to the last page and there are only (for example) 5 records, then select to view 25 records per page, that is reflected immediately at the moment. That might in fairness have been an incorrect decision of mine.

    I can see the arguments both ways, so I'd be interested in what everyone one would expect the behaviour to be in this case.

    Regards,
    Allan
  • rodrigo_rodrigo_ Posts: 2Questions: 0Answers: 0
    Hi Allan,

    Thanks for this big piece of software!!! It is great!!! And also for your quick reply.

    Regards,
    Rodrigo
  • sd_zuosd_zuo Posts: 78Questions: 1Answers: 0
    edited September 2011
    I agree with Rogrigo.
    Currently if the user navigates to the last line, changes the page size[1], pages BACK and then FORWARD again[2], what he/she sees on the last page at time spot [1] and [2] is not identical--some records at spot [1] appear to be "gone" at the second time when the last page is displayed again. This is can confuse the user.
  • wblakencwblakenc Posts: 78Questions: 17Answers: 1
    I have also run into this problem doing a server side request. The request is made correctly, and actually gets the correct data back (I can confirm this using firebug) however, the datatable appears to freeze (with a message: "processing ...") and the last page never renders. Like I said, using firebug I can see that the request was made, and the expected results are returned, but the table never updates. Not sure why. Any ideas?
  • allanallan Posts: 63,542Questions: 1Answers: 10,476 Site admin
    @wblakenc: I doubt that what you are seeing is the same problem - that sounds like a JSON formatting problem. I'd suggest looking at the returned JSON and running it through jsonlint.com. If that doesn't help, can you open a new thread for the discussion on it.

    Thanks,
    Allan
  • allanallan Posts: 63,542Questions: 1Answers: 10,476 Site admin
    I've removed this from the announcements as there hasn't been all that much feedback. However, this is an issue I'm going to leave open, and my current feeling is that I'm going to change it to the behaviour you suggest in the next major release (1.9 or 2.0).

    Regards,
    Allan
  • pradeeppradeep Posts: 1Questions: 0Answers: 0
    Hi Allan,

    Was the fix for above mentioned issue by Rodrigo, done in any of the release?. I'm too facing the issue and it looks weird from a end user perspective.

    Thanks
    Pradeep
This discussion has been closed.