5bxaba
Last Updated: February 25, 2016
·
2.836K
· iondrimba
178548

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);
}
Say Thanks
Respond