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 5: CollectionView

By this point, you should have learnt a few things about View and ItemView. Now we’ll be diving into another view type: CollectionView. While it is possible to use an ItemView to display data from a collection, you need to loop over the collection’s models manually in the template, so you end up with a single view that displays all the models in the collection.

CollectionView does things a bit differently. It is designed to automatically loop through the collection for you, and create a new child view to represent each model. Since each model has a view that is solely in charge of that model, the views have simpler, more fine-grained control over displaying changes to their individual models. In the next chapter, we’ll ...

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