edx/edx-platform — pull request #1749 by zubair-arbi (2013-11-22 10:32:34+00:00)
Title: Added baseview(extended from backbone view), which can further extended ...

...by other views

STUD-823
@adampalay
@cahrens

Steps for making baseview afterRender function to work:
1). Extend view from BaseView
2) Add line below in initialize function of view to call initialize function of baseview:
```JavaScript
ViewName.__super__.initialize.apply(this, arguments);
```

Sample for extending other views from this baseview:

```JavaScript
define(["backbone", "underscore", "js/baseview"],
function(Backbone, _, BaseView) {

var AbcView = BaseView.extend({
events: {
"click .save-button" : "onSave",
},

initialize: function() {
AbcView.__super__.initialize.apply(this, arguments);

this.template = _.template($("#abc_template").text());
var self = this;
self.render();
},
)};
return AbcView;
)};
```