0
我很奇怪,爲什麼_.bindAll(this, ['onSortRemove']);
在下面的代碼(1)上升以下錯誤:事件綁定在Backbone.Marionette方面
Uncaught TypeError: Object [object Window] has no method 'resetItemViewContainer'
把事情的工作,我需要執行下面的代碼_.bindAll(this);
。
我的問題是:應該_.bindAll(this, ['onSortRemove']);
夠了嗎?如果不是,爲什麼?
(1)
initialize: function() {
_.bindAll(this, ['onSortRemove']); // it does not work
_.bindAll(this); // it works
}
onSortRemove: function() {
setTimeout(this.render, 0);
}