ページでノックアウト js ビュー モデルを使用していますが、jquery ダイアログに設定した div にあるクリック バインディングを除いて、すべてが正常に機能します。
ここにdivがあります
<div id="CancelModal" title="Cancel">
Changes to the definition have been detected. Do you want to exit and discard the changes?"
<div style="position: absolute; bottom: 8px; right: 8px; text-align: right">
<input type="button" value="Yes" data-bind="click: cancelConfirm" />
<input type="button" value="No" data-bind="click: cancelDeny" />
</div>
</div>
それから私のjquery
$("#CancelModal").dialog({
modal: true,
autoOpen: false,
width: 400,
minHeight: 150,
maxHeight: 150,
position: "center",
resizable: false
});
次に、私が持っているビューモデルで
...
cancelConfirm() {
alert("confirm");
}
cancelDeny() {
alert("deny");
}
バインディングは設定されていますが、このダイアログの要素に対してのみ機能していません。jquery ダイアログ コードを削除すると、機能します。ここで何をする必要があるか考えていますか?