0
我有一個觀點骨幹事件
app.View.FriendRequestButtonView = Backbone.View.extend({
initialize: function() {
this.set(a, b, c);
app.on('foo', this.reject, this);
app.on('boo', this.accept, this);
},
reject: function(){
this.set(false, false, false);
},
accept: function(){
this.set(true, false, false);
},
set: function (a, b, c){
if(!a && b && c){
this.events = {
"click .cancel": "dosomething"
};
this.render();
}
}
........
}
當我通常調用視圖事件"click .cancel": "dosomething"
作品,但是當我通過foo
或boo
事件不工作觸發它。我做錯了什麼?