Backbone.js calling render after collection is populated

后端 未结 4 1193
情书的邮戳
情书的邮戳 2021-01-28 14:49

I\'m trying to call render after fetch of a collection.

In my initialize method I have:

this.collection.bind(\'all\', this.render, this);
this.collection         


        
4条回答
  •  囚心锁ツ
    2021-01-28 15:37

    The following should work:

    this.collection.on('reset', this.render);
    this.collection.fetch();
    

    Normally in Backbone.js one would use on() to bind a callback to an object.

提交回复
热议问题