title: backbone.js view inheritance. `this` resolution in parent
body: <p>I have a case that uses view inheritance, and my code looks essentially like:</p>
  
  <pre><code>parentView = Backbone.View.extend({
      events: {
          "some event": "business"
      },
      initialize: function(){
          _.bindAll(this);
      },
      business: function(e){
          ...
          this.someFunc &amp;&amp; this.someFunc();
          ...
       }
  });
  
  childView = parentView.extend({
      events: {
          ...
      },
      constructor: function(){
         this.events = _.extend( {}, parentView.prototype.events, this.events );
         parentView.prototype.initialize.apply( this );
      },
      initialize: function(){
         _.bindAll(this);
      },
      someFunc: function(){
         ...
      }
  });
  </code></pre>
  
  <p>Update: Moved <code>this.events</code> extension to the constructor.</p>
  
  <p>My child view has <code>someFunc</code> in it, and during some business function in the parent view, it should call that function if it exists.  If <code>this</code> is properly set to the childView, then <code>this.someFunc</code> should exist.  This, however, is not the behaviour that I am experiencing.</p>
  
  <p>During the <code>initialize</code> function (in the parent), <code>this</code> is indeed set to the child view.  However, when <code>some event</code> fires, the <code>business</code> function is called with <code>this</code> set to <code>parentView</code>.</p>