Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7727109
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T05:22:38+00:00 2026-06-01T05:22:38+00:00

A Backbone app which I’m developing has a collection and a model, and associated

  • 0

A Backbone app which I’m developing has a collection and a model, and associated views for each item.

https://gist.github.com/2255959

When I click on the PostView, unexpectedly, the event fires on the collection without any wiring.

I figured I’d need to bind an event to the model, then have that fire an event on the collection. Is that not the case? Does a collection automagically inherit events fired its child models?

I’m uncertain, but I think it has something to do with the nested views, and maybe the event is being bound on both places instead of just the inner el.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T05:22:39+00:00Added an answer on June 1, 2026 at 5:22 am

    From the fine manual:

    Any event that is triggered on a model in a collection will also be triggered on the collection directly, for convenience.

    So yes, the collection listens to events on all of its models and forwards them.

    For example, given a simple set up like this:

    class M extends Backbone.Model
    
    class C extends Backbone.Collection
        model: M
    
    c = new C
    c.on('change', (model, opts) -> console.log('Change on collection'))
    

    Doing c.first().set(...) will trigger the event handler.

    Demo: http://jsfiddle.net/ambiguous/wwjnK/

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm developing backbone app, which makes crossdomain restful request. The nested data structure in
I am creating an app in Backbone.js which has a parent and multiple child
I am developing a Backbone app which heavily relies on a REST API using
I'm in the process of creating a Backbone.js app using Require.js. Each view file
I have a backbone.js app ( www.github.com/juggy/job-board ) where I want to bind my
I'm currently using Handlebars.js (associated with Backbone and jQuery) to make a web app
In my backbone.js app, there is a Trips collection that holds Trip models ,
I have an app which has a main activity that calls other activities on
I have notifications in my Rails & Backbone.js app // MODEL NotificationModel = App.BB.Model.extend({
I have inherited a half-finished mobile app built using Backbone.js (which I have never

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.