Search code examples
javascriptbackbone.js

Getting Started - Collection is not populating View


I try to render this data by doing

this.listenTo(this.collection, 'reset', this.render);
console.log(this.collection);

I'm assuming a reset event is called when I do a fetch but I'm not 100% sure.

My Collection is defined as such:

var FavoritesTable = Backbone.Collection.extend({
    Name: 'FavoritesTable',
    model: FavoritesRow,
    url: $A.Reg.get('_path_ajax'),
    initialize: function (models, options) {
        console.log(this.fetch(options));
    }
});

Solution

  • According to the source, it does not trigger a reset but a sync event.