mardi 3 juin 2014

knockout binding for each trying to manipulate single elements in the for each loop


Vote count:

0




In a for each binding, how would I go about trying to toggle single p rather than all the P elements in the for each binding, hope that's not too confusing :)



<div data-bind="foreach: items">

<p data-bind="click:somefunction" class="p1"> </P>

<p class="p2"> </p>

</div>

var shellModel = {
observables .....,
somefunction: function() {

....here i need to toggle p2
}
}


asked 41 secs ago

saj

379





Aucun commentaire:

Enregistrer un commentaire