O'Reilly logo

Better Backbone Applications with MarionetteJS by Joseph Zimmerman, Smashing Magazine

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 6: CompositeView

In the last chapter, we discussed CollectionView. This chapter is about CompositeView, which inherits most of its functionality from CollectionView, so most of what I’ve mentioned in chapter 5 is also true for CompositeView. There are differences, obviously — otherwise we wouldn’t need both view classes — and instead of going through everything about CompositeView, this chapter will only explain what’s different between CollectionView and CompositeView.

Rendering

CollectionView cannot render templates (it simply appends the child views to its el), but CompositeView can render a template, so rendering — and the properties that affect it — is probably the biggest difference between the two view types. There are also some other ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required