Code Monkey home page Code Monkey logo

Comments (6)

addyosmani avatar addyosmani commented on May 20, 2024

Confirmed. Thanks for the heads up! I'll get this fixed up as soon as possible.

from backbone.paginator.

addyosmani avatar addyosmani commented on May 20, 2024

I've been looking at this problem this evening and there are a few different options we have available to us. To provide some background information on what is happening:

Say we have 30 results in total with 3 results shown per page. When you navigate to a page N (e.g 9) and then set the number of records to display per page to M (e.g 12), your current paged page is no longer valid as there would only be a maximum of 3 pages available for a user to browse to. This is why nothing displays when you land on the page.

Our options for what to do here are as follows:

  • When a user changes the number of results to display per page, reset the pagination completely so that they must start browsing from the first page of results
  • Attempt to determine what new page the set of results they were previously viewing is now on (e.g for page 9, this would probably be page 3) and then show them this page.

@dgs700 which of these makes the most sense to you?

from backbone.paginator.

addyosmani avatar addyosmani commented on May 20, 2024

Just to note: pagination systems like eBay appear to reset so the user must browse from the first page

from backbone.paginator.

addyosmani avatar addyosmani commented on May 20, 2024

I just pushed a patch which resets you to the first page of the set if you change the number of results to display per page. This falls in line with how other pagination systems appear to approach the problem. If you agree with the fix, I'm happy to close this issue.

from backbone.paginator.

dgs700 avatar dgs700 commented on May 20, 2024

I had actually hacked it to do option 1. For my use case there typically will always be a low number of records (<100) and having pagination capability on the page is not a critical function, so just resetting to page 1 works for me. So its a closed issue from my standpoint.

Option 2, recalculating the current page and then going from there, would probably be the solution that would satisfy the developer who is really anal about having their pagination work on any change from any point in the record set. I'm not one of those, but if I was providing a paginator, I would probably shoot for having the option 2 functionality at some point just so I wouldn't have to hear from them. My two cents on that.

Thanks!

from backbone.paginator.

addyosmani avatar addyosmani commented on May 20, 2024

Thanks for the feedback @dgs700!. I think supporting option 2 is definitely something I'll consider for the future. For now, as option 1 seems to solve what i imagine most people will be after, I'll close it.

Appreciate you pointing this out once again!

from backbone.paginator.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.