How to clear views inserted with insertView before rendering again
This article assumes you are using backbone.layoutmanager.js to manage your views. You have also used insertView({}) to add a list of models in a collection.
The following will remove all child views inserted with this.insertView(), assuming you are using backbone.layoutmanager
beforeRender: function()
{
this.removeView();
}
Source : http://stackoverflow.com/questions/7379263/disposing-of-view-and-model-objects-in-backbone-js
Recent Comments