This question has been striking me for many days…
Let’s say I have a very simple Backbone app with a list of items. When you click on an item, you see a detailed view of this item.
Is it better to
- create just ONE DetailedView and reuse it when the user clicks on the
different items ; OR - create one new DetailedView at each click ?
I prefer option 2, but there issues because I don’t destroy the views properly, and get the infamous “ghost views” problem with events firing from nowhere !
What is the best practice ?
I re-use views in similar circumstances. Just reuse DetailedView. That way: