我在我的页面上使用了JQuery Dialog Widget制作的对话框。我已经设置好了两个按钮的功能,它们将点击页面上的不同按钮,从而触发页面回发并执行各种操作。
当对话框为modal:false时,对话框将执行相关的clickButton函数。但是,当我设置 modal:true 时,虽然函数已被调用,但按钮却不会被点击。
我猜想我可能忽略了关于 modal:true 所执行的与按钮相关联的功能的某些内容。
以下是我的javascript代码:
function displayQuoteToCashMessage() {
//this is where we do that alert for the QuoteToCash request stuff
$("#<%=divQuoteToCashAlert.ClientId %>").show();
$("#<%=divQuoteToCashAlert.ClientId %>").dialog({
modal: false,
resizable: false,
buttons: {
"Ok": function () {
//save confirmations
clickButton(true);
$(this).dialog("close");
},
"No": function() {
clickButton(false);
$(this).dialog("close");
}
}
});
}
function clickButton(b) {
//do something with b
document.getElementById(btnSave).click()
};