I believe that the sync event is fired only when the model changes. Therefore, if you create, update, or delete a model, the "sync" event will occur.
In your case, I think you want to listen to the "reset" event in the collection.
Edit: If you set the {add:true}
parameter, then there is no single Master event that will fire after all models have been added. You have several options:
- Just listen to the
add
event and expect it to be called again - Emulating a single event using a handler that was debugged using the
_.debounce()
function. The return value from fetch()
is a jQuery XMLHttpRequest object. It implements the deferred jQuery interface . So you could listen to this finish. For instance:
myCollection.fetch({add:true}).done(function(){ myView.render();
source share