knockoutjs click binding within foreach binding

后端 未结 1 1978
长发绾君心
长发绾君心 2021-02-15 17:24

EDIT: Problem was not related to the binding but to a simple JavaScript mistake.

I have a question concerning a click binding within a foreach binding.

1条回答
  •  悲&欢浪女
    2021-02-15 17:49

    You had me for a second!

    You are correct, $parent should be required. Your mistake was not defining self in your viewmodel. After doing that, $parent was required on the removeButton, as well as the masterData binding.

    Here is a working fiddle: http://jsfiddle.net/FpSWb/

    0 讨论(0)
提交回复
热议问题