I have a top level PageView that will re-render itself whenever the route changes. I have many nested sub-views embedded into this PageView. If I was to re-render PageView, do
A bit like Zengineer wrote, i like to patch Backbone.View.remove globally like the following, so that any child views attached on this are removed
var originalRemove = Backbone.View.prototype.remove;
Backbone.View.prototype.remove = function ()
{
for (var view in this){
if (this[view] instanceof Backbone.View && this[view] != this) {
this[view].remove();
}
}
originalRemove.apply(this, arguments);
}