Backbone.js sync event in collection
backbone-events, backbone.js, javascript
Solution
The solution is to fire up sync event maunually in 'success' callback passed as param to fetch method.
this.collection.fetch({add: true, success: function(collection, response){
collection.trigger('sync');
}});
Problem
According to doc here: http://documentcloud.github.com/backbone/#FAQ-events collection has sync event fired when I do something to sync collection with server. I try to invoke fetch method on collection and wait for sync event on it, but it never happens. Add event is fired, but I need only one event after syncing all items in collection to update corresponding view. There is another way to get this event fired?