-
Notifications
You must be signed in to change notification settings - Fork 64
Infinite Scrolling, Parse Link Error #150
Comments
http://backbone-paginator.github.io/backbone-pageable/api/#!/api/Backbone.PageableCollection You just need to return an object with a next link like this |
The links must be a URL, not an HTML anchor fragment. You must also construct the links object using the data from the |
@wyuenho i have tried with URL also but still it gives the same error |
That's because you need to return a new link for every page you fetch. Also, I'm not sure CoffeeScript's class syntax is compatible with Backbone's extend. You might just want to use Backbone.PageableCollection.extend instead. |
Hey @wyuenho I have gone through documentation of parseLink it is sayint that it returns an Object, what kind of object does it needs to be return, or what would be the format of Object. Moreoever you are saying i need to return a new link for everypage I fetch. I am just calling it 2 times, as follow collection = ChozAdmin.Collections.Accounts()
collection.getFirstPage() # till here everything works OK
collection.getNextPage() # here it gives me the error
# OR if i do
collection.getPage(2) # still it gives me the error |
The format of the object is just what the document says:
|
Thank you so much @wyuenho, now everything is working fine, i am fetching the collection and appending in the view, the only issue i am left with is, its still giving me the same error,
while the data fetching and showing perfectly in browser. Also this time my URL is dynamic as follow, { next: "http://localhost:3000/api/accounts?to=#{xhr.to}" } |
|
If you return an empty object you are suppose to get an error. How else do I signal the end of infinite paging? Your Which version of backbone-pageable are you using anyway? |
@wyuenho I am using latest version Will you please elaborate how can i detect the end of page ? Or what would be the format of hash that parseLink has to return when last page is shown ? Another question is, does |
Hello, I am trying to add infinite scrolling in my page, everything is working fine. Here is what i am doing.
But when i do
@collection.getnextPage()
It gives me following error
RangeError: No link found for page 1.
. I believe the issue is with my collection where i am overriding the parseLink as follow.Will somebody please example me how to override the parseLink and what Linkheader format it will return. Or if there is something other problem, then please explain. I shall be very thankful to you guys.
here is my collection code
The text was updated successfully, but these errors were encountered: