Skip to content
This repository has been archived by the owner on Apr 2, 2019. It is now read-only.

Paginator pages backwards when an empty collection is supplied #33

Closed
wyuenho opened this issue Jan 29, 2013 · 6 comments
Closed

Paginator pages backwards when an empty collection is supplied #33

wyuenho opened this issue Jan 29, 2013 · 6 comments
Labels
Milestone

Comments

@wyuenho
Copy link
Contributor

wyuenho commented Jan 29, 2013

http://stackoverflow.com/questions/14580336/backgrid-how-does-it-know-what-numbers-to-generate-for-pagination

@benhowdle89
Copy link

// collection  
state: {
    pageSize: 15
}

// view
// Initialize a new Grid instance
var grid = new Backgrid.Grid({
    columns: columns,
    collection: that.collection,
    footer: Backgrid.Extension.Paginator
});

@wyuenho
Copy link
Contributor Author

wyuenho commented Jan 29, 2013

Same code as this?

http://snippi.com/s/6uecqkq

Can you paste the response of the URL here?

@benhowdle89
Copy link

The URL that is generated by the pagination links is: https://api.com/quotes?page=-17&per_page=15 for example.

Like I mentioned in the SO question, server side handling of params isn't implemented yet, so it just returns a full set regardless. But I'm interested to know why there are minus numbers generated...

@wyuenho
Copy link
Contributor Author

wyuenho commented Jan 29, 2013

Ok I really can't reproduce this problem. I'll need a full jsFiddle for this.

@wyuenho
Copy link
Contributor Author

wyuenho commented Feb 1, 2013

Ok, I've done a little bit of code fiddling and reading and I still failed to come up with a case to generate a PageableCollection state that gives you a negative page number. Backgrid.Extension.Paginator can't generate negative page numbers unless you have a negative first page number, and you can't have a negative first page number unless you set it explicitly by hand and have overridden PageableCollection to skip checkState.

@wyuenho
Copy link
Contributor Author

wyuenho commented Feb 6, 2013

I'm going to close this for now. Let me know if this is still bothering you and can provide a working jsfiddle.

@wyuenho wyuenho closed this as completed Feb 6, 2013
@wyuenho wyuenho reopened this Apr 29, 2013
@wyuenho wyuenho closed this as completed in d9a5319 May 5, 2013
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants