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

The best way to implement nested binding for all list items

$
0
0
Say I have a list if items, each item has field title

  1. items: [{tilte: 'title1'},  tilte: 'title2'}, ... ]

I want to bind to changes of title field of any list item. Is there better way to implement this than:


  1. items.bind('change', function(ev, attr){

  2.     if ( attr.match(/(\d+)\.title$/i) ){
  3.     ....
  4.     }
  5. })

?

Viewing all articles
Browse latest Browse all 3491

Trending Articles