Last Updated: February 25, 2016
·
4.166K
· iondrimba

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);
}