Flu*_*yte 0 collections listener backbone.js
initialize
我的视图中有多个听众,看起来像这样:
this.collection.on('reset', this.render);
this.collection.on('add', this.render);
this.collection.on('change', this.render);
Run Code Online (Sandbox Code Playgroud)
我很好奇是否有办法将所有这些组合在一起,因为他们都会解雇 render
也许你可以试试
this.collection.on("reset add change", this.render);
Run Code Online (Sandbox Code Playgroud)
看看这个.它在那里显示,但不确定是否将它与默认的集合事件绑定.
归档时间: |
|
查看次数: |
1350 次 |
最近记录: |