I have a composite view which has a task, and it's comments. I put it onto a contentRegion to display. When rendering model alone, it works fine. However when come to collection, it behaves really strange. console.log shows initialize function has been triggered twice. The first time is when define the view
taskView = new MyProject.Views.Task
model : task
collection : comments
I then do a MyProject.contentRegion.show(taskView)
in order to render the model view. After that, I just call comments.fetch()
to get all the comments. Then comes the problem, it re-initialized my taskView
and the template keep complaining xxx is undefined.
Any thoughts? I know it's weird because another CompositeView in my project works great.