javascript - How to stop event bubbling on editing a view in Ember -
javascript - How to stop event bubbling on editing a view in Ember -
i working on editable views in ember, click here see jsbin , have issue anytime want edit current view. can see problem 1 time click edit single view, other transactions become editable, don't want this, want single item becomes editable, not of them. don't know doing wrong, other hand if delete 1 , works well.
in controller function:
edit:function(ob){ this.map(function(item,index){ if(ob.id===item.id) em.set(item,'editable',true); }); },
i think problem stemming fact there no .id property on objects you're trying compare.
try this...
this.foreach(function(item) { if (ob === item) { em.set(item, 'editable', true); } });
although did notice in code, adding edit input when add together item list, , there binding going on. should reply question setting edit each individual item.
the reason function setting of items editable, because ob.id === item.id, since both don't exist, it's truthy statement...hence items set editable = true.
happy hunting!
javascript jquery ember.js jsfiddle jsbin
Comments
Post a Comment