Also refernced: cloudflarearchive/backgrid#430
This issue only happens when goBackFirstOnSort is set to true
This is also in refernece to the question located here: http://stackoverflow.com/questions/tagged/backgrid I did bower install backgrid / backgrid-pagnitor late yesterday afternoon.
Steps to reproduce:
- Configure PageableCollection:
state: {
pageSize: 10,
order: 1,
totalRecords:315586
},
queryParams: {
currentPage:'page',
pageSize: 'size',
sortKey: "sort"
},
- Click on the header for sort (name in this case).
Observer outbound request.
?page=1&size=10&total_pages=31559&sort=name&order=asc
Sorted results come back. Briefly carret displays and then disapears.
- Click on the header again (name)
Observer outbound request:
?page=1&size=10&total_pages=31559&sort=name&order=asc
Like I said in the question above, I'm new to backgrid but would be happy to provide anything you need if you believe this to be a defect and not a dev issue.
Here's the objects coming in to parsestate funciton:
queryParams
Object {currentPage: "page", pageSize: "size", totalPages: "total_pages", totalRecords: "total_entries", sortKey: "sort"…}
currentPage: "page"
directions: Object
order: "order"
pageSize: "size"
sortKey: "sort"
totalPages: "total_pages"
totalRecords: "total_entries"
__proto__: Object
state
Object {firstPage: 1, lastPage: 31559, currentPage: 1, pageSize: 10, totalPages: 31559…}
currentPage: 1
firstPage: 1
lastPage: 31559
order: -1
pageSize: 10
sortKey: "name"
totalPages: 31559
totalRecords: undefined
__proto__: Object
What's interesting here is "order" is now -1 and totalRecords is now undefined.
options
Object {from: 1, to: 1, url: "/search/cars/", data: Object, parse: true…}
add: true
data: Object
emulateHTTP: false
emulateJSON: false
error: function (resp) {
failure: function (){}
from: 1
merge: true
parse: true
remove: true
success: function (resp) {
to: 1
url: "/search/cars/"
xhr: Object
__proto__: Object
Incoming response looks something like this:
[{"sort": "name", "total_entries": 315586, "order": "asc"}, [{},...]]
Also, when I put a debugger; in parseState debugger triggers twice per sort. However the init (page load) only triggers the debugger once.
Pagination works fine.
Also refernced: cloudflarearchive/backgrid#430
This issue only happens when goBackFirstOnSort is set to true
This is also in refernece to the question located here: http://stackoverflow.com/questions/tagged/backgrid I did bower install backgrid / backgrid-pagnitor late yesterday afternoon.
Steps to reproduce:
Observer outbound request.
Sorted results come back. Briefly carret displays and then disapears.
Observer outbound request:
Like I said in the question above, I'm new to backgrid but would be happy to provide anything you need if you believe this to be a defect and not a dev issue.
Here's the objects coming in to parsestate funciton:
What's interesting here is "order" is now -1 and totalRecords is now undefined.
Incoming response looks something like this:
[{"sort": "name", "total_entries": 315586, "order": "asc"}, [{},...]]Also, when I put a
debugger;in parseState debugger triggers twice per sort. However the init (page load) only triggers the debugger once.Pagination works fine.