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

Templated Event Handlers & Observe.List

$
0
0
Hi All,

I have a Can.Control that essentially functions as a list of items.  I'd like to listen to attribute changes made to individual items in this list.

The list is a Model.List, which is bound to my controller via list.options.items.

What's the best way to do this?  I can define a templated event handler using '{items} change' to listen to any change to any item in the list, but that seems awfully inefficient.  I also need to listen to attribute changes before the model is saved, so '{Item} updated' also doesn't work for me.  

Is it preferable to create a separate Can.Control for each list item, or is there some sort of alternative syntax (eg '{items} {Item} attribute') that would allow me to listen for changes to individual items in the list, rather than the entire list itself?

Thanks!

Viewing all articles
Browse latest Browse all 3491

Trending Articles