-
Notifications
You must be signed in to change notification settings - Fork 64
parseRecords getting called twice #71
Comments
|
No. The collection is really simple. I don't have the code in front of me at the moment and can put exact code tomorrow, but it looked something like this. var MyCollection = Backbone.PageableCollection.extend({
model: MyModel, // This may or may not be there.
url: "/some/path",
parseRecords: function(response) {
return response.Data || response;
},
save: function() {
return this.sync("update", this);
}
}); I'm pretty sure that's all that's in there, but I will double check that tomorrow. |
The only thing I missed from the code above is |
I have this exact same thing somewhere else that doesn't have |
Same issue with mode: "infinite".
|
Can you see if you can reproduce this problem on Backbone 0.9.10? |
I think the issue comes from https://github.com/documentcloud/backbone/blob/master/backbone.js#L860 which was not present in the 0.9.10, i cannot test it, i have some errors before ^^ |
I have overridden parseRecords because the data being returned is an object with an array on it.
The data being returned:
Normally in backbone I would just do this:
parseRecords is getting called twice. The first time it is giving me the data from the server, but the second time it gives me the array of models that I returned from the first call.
Is this expected behavior or am I doing something wrong? It seems odd to me.
I'm able to workaround it by doing this:
The text was updated successfully, but these errors were encountered: