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 6545701
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T11:37:04+00:00 2026-05-25T11:37:04+00:00

So i got this sub model associate to 1 list item of my view,

  • 0

So i got this sub model associate to 1 list item of my view, when I edit this model, the view is re rendered correctly.

But I also got other things parent do when the complete list model change, and the change event is not firing at the aprent level which is weird,

if I manually fire model.change() I see the content updated from the submodel (meaning the parent model as effectively changed).

Is there an automatic way to propagate the change event to the parent model?

  • 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-05-25T11:37:05+00:00Added an answer on May 25, 2026 at 11:37 am

    Is your “parent” the collection in which the sub-model belongs? If so, the collection will receive a change notification whenever an attributes of the sub-model changes. Here’s an example that demonstrates the model / collection change event:

    var Product = Backbone.Model.extend({});
    var Products = Backbone.Collection.extend({
        model: Product
    });
    
    var ProductsView = Backbone.View.extend({
        initialize: function () {
            this.collection.bind('change', this.onProductChange, this);
        },
        onProductChange: function (product) {
            console.log('product with ID ' + product.get('id') + ' changed to ' + product.get('name'));
        }
    });
    
    var products = new Products([{ id: 1, name: 'Book' }, { id: 2, name: 'Toy' }, { id: 3, name: 'Shirt'}]);
    new ProductsView({collection:products});
    
    products.get(1).set({ name: 'TV' }); // console: product with ID 1 changed to TV
    

    On the other hand, if your “parent” is not a collection of your sub-model and there’s simply a parent/child relationship, then Backbone has no way to know about the relationship, so you will need to trigger the change event on the parent whenever a child changes. For example:

        var Parent = Backbone.Model.extend({
            includeChild: function (child) {
                child.bind('change', this.onChildChange, this);
            },
            onChildChange: function (child) {
                console.log('Child with name ' + child.get('name') + ' changed.');
            }
        });
        var Child = Backbone.Model.extend({});
    
        var parent = new Parent();
        var child = new Child({ name: 'Bob', parent: parent });
        parent.includeChild(child);
    
        child.set({name: 'Joe'}); // console: Child with name Joe changed.
    

    Here’s a complete list of Backbone events: http://documentcloud.github.com/backbone/#FAQ-events

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

Sidebar

Related Questions

Got this error message while trying to load view: The model item passed into
Got this line of code here but its not working. private void Button_Click(object sender,
I´ve got this on the parent object @OneToMany(mappedBy=idUser, cascade = CascadeType.MERGE) public List<Directions> directions;
I've got an article model which uses STI. The sub classes are emotions, categories,
Say you've got a MethodInfo, or any other sub-class of MemberInfo for that matter,
Got this site with UN/PW set via the Createuserwizard control. Client considers PW too
Got this: Table a ID RelatedBs 1 NULL 2 NULL Table b AID ID
Got this code for a viewscroller from the apple developers site. @synthesize scrollView1, scrollView2;
Got this error on a big $_GET query in size ~9 000 symbols (they
Got this design issue with JSF + Spring :- I got a datatable on

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.