Is it technically possible to nest views, using templating, something like that:
<%= new PhotoCollectionView({model:new PhotoCollection(model.similarPhotos)}).render().el) %>
I can put all the stuff in the render method as well, but templating gives much more room for flexibility and layout.
I tried the aforementioned variant, but all I get as a result on the screen is [HTMLDivElement]
.
If I try to extract just the HTML out ouf it, using jQuery's HTML, I get it rendered, but it turns out that the DOM nodes that get printed out are different from the ones that the views hold a reference to, because no interaction whatsoever with those DOM nodes is possible using the view instance. For instance if within the view I say $(this.el).hide()
, nothing will happen.
What is the proper way, if any?