I have a WorkoutExerciseRowView which extends ExerciseRowView. The render functions are extremely similar, except the WorkoutExerciseRowView must add a few parameters to ExerciseRowView‘s render. How can I call ExerciseRowView‘s render function inside WorkoutExerciseRowView‘s render function?
var WorkoutExerciseRowView = ExerciseRowView.extend( {
render : function() {
//return this.constructor.render({ // doesn't work
return this.render({ // doesn't work
workoutExercise : this.model,
exercise : this.model.get("exercise"),
workoutSection : this.model.get("section"),
isEditable : true,
number : this.number,
WorkoutExercise : WorkoutExercise,
WorkoutSection : WorkoutSection
});
}
});
Thanks!
From Backbone’s documentation here: http://backbonejs.org/#Model-extend
Backbone.Model.prototype.set.call(this, attributes, options);