Backbone Collection多个on()侦听器

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

Cyc*_*one 5

也许你可以试试

this.collection.on("reset add change", this.render);
Run Code Online (Sandbox Code Playgroud)

看看这个.它在那里显示,但不确定是否将它与默认的集合事件绑定.