Socket
Book a DemoInstallSign in
Socket

Backbone.Overview

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

Backbone.Overview

An Overview is a View that contains and keeps track of sub-views. Kind of like what a Collection is to a Model.

latest
Source
npmnpm
Version
0.0.2
Version published
Maintainers
1
Created
Source

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:

    <script type="text/javascript" src="backbone.js"></script>
    <script type="text/javascript" src="backbone.overview.js"></script>

Create your overview like this:

    this.RosterView = Backbone.Overview.extend({
    // ... same customizations as you would make for a normal Backbone.View
    });

Underscore

You can use the usual underscore methdods, like you can with Backbone Collections.

For example:

    this.rosterview = new this.RosterView();
    this.rosterview.add(new Backbone.View({model: new Backbone.Model()));

    this.rosterview.each(function (view) {
        // Do something
    });

RequireJS

Include RequireJS:

    <script type="text/javascript" src="lib/require.js"></script>

RequireJS config:

    require.config({
        paths: {
            jquery: "lib/jquery",
            underscore: "lib/underscore",
            backbone: "lib/backbone",
            backbone.overview: "lib/backbone.overview"
        }
    });
    define(["backbone.overview"], function() {
        this.RosterView = Backbone.Overview.extend({
        // ... same customizations as you would make for a normal Backbone.View
        });
    });

Real-world example

Overviews are used in converse.js

Keywords

backbone

FAQs

Package last updated on 11 Aug 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.