I called fetch, and it hits the server.
Now...my server returns models back...how can I get those just-added models?
I called fetch, and it hits the server.
Now...my server returns models back...how can I get those just-added models?
the fetch method has a success callback with the following signature:
success: function(collection, response){
}
the collection
argument is your collection with the newly added models as well as whatever was there previously. response
is the json response from the server. So you could look up the models in collection
using the ids from response
to get the 'just-added models'.