Reputation: 569
I have backbone collection and under some circumstances I am fetching more models into the collection with:
collection.fetch({data: {...}, add: true});
I need view of the collection to be re-rendered when new members arrive. "reset" event is not fired because of add:true parameter hence I see two options.
I haven't found any other way to overcome the issue :( Any advises what should I do in this case?
Upvotes: 0
Views: 807
Reputation: 9593
you can also pass success
callback as option to the fetch method and trigger full rerender after successful ajax operation if this is your preferred way of doing it
collection.fetch({data: {...}, add: true, success: function() { ... } });
// or reference to function - you get the drill
Upvotes: 2