I am using Backbone.js in my project. I have created a new instance of a view in a render function of another view
render: function (data) {
var newView = new View();
}
need to call same render function again and again without refreshing the page. if i do so, it creates multiple instances. How do i destroy/hide the previously created instance before creating the new one?
Store a reference to your view and then destroy it when you create a new instance with
view.remove
/view.undelegateEvents
/ custom code to completely detach it: