Reputation: 4367
I have a table - compositeView, with rows - itemView. Each row has many events - click, change and more.
In certain state, I would like to 'lock' the table. disable buttons and cancel events.
Is there a nice way to cancel all events on itemview - at once?
Upvotes: 1
Views: 133
Reputation: 81
I would keep a variable in the intialize function of the view to something along the lines of this.canWeDoEvents = true. Then inside of each event function do a check on
someClickEvent: function(){
if(this.canWeDoEvents===true)
{
//doevent
}
}
Upvotes: 0
Reputation: 1755
I presume you're talking about the jQuery events created with Backbone's events
hash. You can remove them by calling undelegateEvents
on Backbone.view
.
Upvotes: 1