Comments (6)
Confirmed. Thanks for the heads up! I'll get this fixed up as soon as possible.
from backbone.paginator.
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.
Just to note: pagination systems like eBay appear to reset so the user must browse from the first page
from backbone.paginator.
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.
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.
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)
- Constructor with parse option incompatible with non-Array models argument HOT 2
- Add same array twice, the collection state show the sum of two array's length
- Add items in the page > first page, the state shows wrong totalPages
- Disabling pagination with infinite mode HOT 8
- sortKey query param is in the url even though it's set to null HOT 1
- Fetch gives along options wich override the url in the child model
- Using with RequireJS and lodash HOT 4
- Defer evaluation of url attribute? HOT 1
- Deleting row doesn't cause a pagination update
- Currentpage-like support for skipped (OData) HOT 3
- Last page not working for parseLink
- _contains is not a function in examples HOT 4
- backbone.paginator v2.0.6 HOT 5
- help typescript HOT 1
- accepting total amount of rows in getPage() HOT 1
- 2.0.6 introduced bug with _.includes in some environments HOT 1
- Feature request: Infinite mode with total records HOT 3
- Demo page not working HOT 1
- infinityjs HOT 1
- Bug: "No link found for page" raised - apparently unnecessary
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from backbone.paginator.