If anyone is having trouble with the collection's 'reset' event not triggering after calling this.collection.fetch(), it's because as of v1.0, the fetch() function only triggers the 'reset' event if you add {reset: true} as an option.
So, that line in the Raffler.Router.Entries() initialize function should actually look like this:
coffee-script
initialize: ->
@collection = new Raffler.Collections.Entries()
@collection.fetch({reset: true})
" If you want to smartly update the contents of a Collection, adding new models, removing missing ones, and merging those already present, you now call set (previously named "update"), a similar operation to calling set on a Model. This is now the default when you call fetch on a collection. To get the old behavior, pass {reset: true}."
Hopefully, when you have some spare time (ha!), you could update this tutorial with that little tidbit =)
Thanks for all your tutorials, I have been learning a ton!
For those who are curious, the following are the types of events that can get triggered for
fetch()
if you decided NOT to do{reset:true}
:fetch()
Hi,
If anyone is having trouble with the collection's 'reset' event not triggering after calling
this.collection.fetch()
, it's because as of v1.0, thefetch()
function only triggers the 'reset' event if you add{reset: true}
as an option.So, that line in the Raffler.Router.Entries() initialize function should actually look like this:
This is from the backbone.js site (Linky):
Hopefully, when you have some spare time (ha!), you could update this tutorial with that little tidbit =)
Thanks for all your tutorials, I have been learning a ton!