I prefer the method below for dynamic events, as this function will be called at any time by delegateEvent .
In docs on the Event deletion, which is called after the view initialize function is executed, you can use this technique to create events dynamically:
var TestView = Backbone.View.extend({ events: function () { var evt = {}; evt['click ' + this._extraSelector] = '_onButtonClick'; return evt; }, initialize: function(config) {
source share