how to dismiss a view that has been replaced by another one properly
I have two views that are associated with the same div element:
MuSe.views.View1= Backbone.View.extend({
el: "#applicationCanvas",
...
MuSe.views.View2= Backbone.View.extend({
el: "#applicationCanvas",
...
I begin with rendering View1 and when the user terminates the interaction
I want to replace everything with View2.
I would like to dismiss View1 properly (unbind it from the div
#applicationCanvas so that the garbage collector can do its job) and to do
so I call undelegateEvents() on it. I can't call remove() because I need
#applicationCanvas for View2. I was wondering if calling undelegateEvents
and replacing the entire dom subtree of #applicationCanvas was enough.
What's your say?
Thanks
No comments:
Post a Comment