Marionette.JS CompositeView example

I have been reading several posts from Deric Bailey lately. He is the creator of Marionette.JS and has good techie advice.

On my journey to learn how to use CompositeViews from Marionette.JS found a link on the official docs pointing to this post from Deric. It was no surprise to me that the samples there were not working. After all, it was posted more than two years ago.

The fix was tiny, but non-obvious to a novice like me: CompositeView inherits from CollectionView and it expects ‘childView’ to be populated instead of ‘itemView’. Another problem from the original fiddle is that it is using non-versioned dependencies so it is sure to be broken again in the future if they are not fixed.

Here is my version of the sample using the compositeView and fixed versions of the libraries:

  • you can make use childViewContainer instead of appendHTML

    childViewContainer: “tbody”