3 ms·
It's just a question of how many subviews you want to make. In this case, I don't really think the label itself needs to be a subview since its such a simple co
by ianstormtaylor 14y ago
It's just a question of how many subviews you want to make. In this case, I don't really think the label itself needs to be a subview since its such a simple component. The only action I associate with labels is for clicking them to focus their associated input. Which wouldn't even be pulled into a LabelView, so there's really nothing to it, so I don't gain much from separating it into its own view.
You can probably argue both ways though, I used to have labels be their own view actually. It just got a bit more uselessly complicated for so little benefit.
If the view you're dealing with is an end node in the view hierarchy (and it's pieces are relatively simple) then I prefer not to split them up because there are costs there as well.
- danso 14y agoThis is the problem I run into every app I make...when I try subviews I usually end up giving up out of annoyance at the complexity
- ianstormtaylor 14y agoDunno if it will help, but I wrote earlier about how I handle rendering subviews: http://ianstormtaylor.com/rendering-views-in-backbonejs-isnt-always-simple/ http://ianstormtaylor.com/rendering-views-in-backbonejs-isnt...