user1102171
user1102171

Reputation: 684

changes in backbone model in child view does not show up in parent view

I am having a similar issue(as https://stackoverflow.com/posts/19889900) that the model passed to a subview only gets updated for that subview and the model in the parent view is not updated. @magulka: is your problem actually solved ?

Here is my code structure:

In my router.js :

var model = new campaignModel();
var parentView = new ParentView({model:model});

In my parent view:

var itemdetail = new itemdetailView({model:this.model}); 

In my child view itemdetail:

this.model.set("key","value");

Now if I check the value of model in parent view...the value set in child does not show up. Any clue. I am not reinstantiating my model in any views. It was created once in the router.

Upvotes: 1

Views: 363

Answers (1)

user1102171
user1102171

Reputation: 684

Sorry.In my callback in parent had some mistake in getting values. So all is well. No problem. Backbone rocks!

Upvotes: 1

Related Questions