Why my Backbone collection fetch returns only one item
Step by steps
- Use Fildder to inspect network traffic, make sure of what is returned by the server has multiple objects.
- Make sure that your IDs are unique
- If you override the base model idAttribute, make sure that all items have a distinct attribute for the one marked as the ID by idAttribute. In the following example, if two item had the same name, only one of them would show up :
Export.Model = Backbone.Model.extend(
{
urlRoot: "/apis/destinations",
selected: false,
idAttribute: "name",
(...)
Recent Comments