如何在knockoutjs中添加多个单击事件到单选按钮?
我现在有这个,
AddDataBind="click: myObject.Event, clickBubble: true"
and I tried
AddDataBind="click: myObject.Event,Event2, clickBubble: true"
和
AddDataBind="click: myObject.Event+Event2, clickBubble: true"
我不知道AddDataBind
语法,但在纯javascript中,您可以这样做
<input type="radio" data-bind="
click:function(data, event){
myObject.Event(data, event);
myObject.Event2(data, event);
},
clickBubble: true
">
但问题是你为什么需要它?可能你的视图模型设计得不好。您能分享更多您的代码和您的意图吗?