Quantcast
Channel: JavaScriptMVC Forum
Viewing all articles
Browse latest Browse all 3491

Question about binding in Observe List.

$
0
0
Hi.

i have this scenario:

A = can.Control({},{
      items: [],
      'init': {
            this.items = can.Observe.List([]);
            this.items.attr(getFromSomewhereAListOfObjects);
            this.b = new B();
      },
      'li click': function(li){
            // get an item from list and
            this.b.items.attr(item.sublist);
      }
});

B is similar and changes some value when i click on the items.
But if i change something in the list, the modification is not visible in A's list. For this to happen, i have to make the change in A's list directly.

Is it possible when i change something in B's list to see it in A also?

Thanks.

Viewing all articles
Browse latest Browse all 3491

Trending Articles