Disable and Enable specific event on a Backbone View
Suppose you have this scenario on your view and you want to add/remove just a specific event.
To disable the event ( paging-next ):
someDisableMethod: function () {
this.events["click .paging-next"] = undefined;
this.delegateEvents(this.events);
}
To enable the event again:
someEnableMethod: function () {
this.events["click .paging-next"] = "onPagingNextClick";
this.delegateEvents(this.events);
}
Written by Ion D. Filho
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#.net
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#