Backbone.Overview
An Overview is a View that references and keeps track of sub-views (i.e. just normal Backbone.Views) Kind of like what a Collection is to a Model.
An Overview provides methods for handling the views it keeps track of:
- add(id, view)
- get(id)
- getAll()
- keys()
- remove(id)
- removeAll()
Usage
Include Backbone.Overview after having included Backbone.js:
Create your overview like this:
thisRosterView = BackboneOverview;
Underscore
You can use the usual underscore methdods, like you can with Backbone Collections.
For example:
thisrosterview = ; thisrosterview
RequireJS
Include RequireJS:
RequireJS config:
require;
;
Real-world example
Overviews are used in converse.js