'backbone.js events are not bound after model change?

Here's the code in the view initialize:

  var self = this
  this.model.bind('change', function () {
    self.render();
  });

I have a bunch of events defined:

events: {
  "click #blah": "blah",
},

But after changing the model and re-rendering the view the events are no longer bound?

I can bind them by putting a this.delegateEvents() in the render, but I don't think that's doing it correctly.

Am I doing something wrong?



Solution 1:[1]

Did you set the el property in your view? The events are delegated to this el.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 donnut