When backgrid paginator is in client mode, I unable to set initial page number, sort column and order type.
I simply created my grid following example in backgrid-paginator-master package then set initial page, order column and order type in following way:
var Profiles = Backbone.PageableCollection.extend({
model: ProfileModel,
mode: "client",
url: JSONUrl,
state: {
firstPage:1,
pageSize:10,
currentPage:3,
sortKey:"idProfile",
order:1
}
});
The data in the grid are shown correctly, that is, the page shown is the number 3 and also the sort column is right but the paginator is not updated according to page passed to currentPage property of PageableCollection: is always shown as the current page to be the first.
Note that everything works fine when click on the different page number in paginator but if I want to go directly on the page 3 at first page loading, the paginator is not shown correctly.
I have reproduced the glitch here:http://85.94.202.20//backgridtest/index.php
and you can call the various pages by passing the value directly in the URL like this:http://85.94.202.20/backgridtest/index.php?page=3
As you can see the data in the grid change, but the paginator does not refresh the active page according set with: currentPage:[page number]
There is another way to force the paginator on the specific page, sort and sort type at first page loading?
I'm using latest versions of the various components:
- underscore.js -> 1.5.2
- backbone.js -> 1.0.0
- backbone-pageable.js -> 1.4.1
- lunr.js -> 0.4.3
- backgrid.js -> master version
- backgrid-paginator -> master version
This shouldn't be a problem anymore as of 0.3.5. Update your libraries and try again.