您的位置:首页 > Web前端 > JQuery

完美解决MVC下使用jQuery UI Dialog Confirm不能确认

2011-04-29 10:58 585 查看
function showConfirmDialog(event) {
if (!$(this).data("IsConfirmed")) {
$("#dialog-confirm").data("button", this);
$("#dialog-confirm").dialog('open');
return false;
} else {
$(this).data("IsConfirmed", false);
return true;
}
}
$(function () {
$("#dialog-confirm").dialog({
resizable: false,
modal: true,
autoOpen: false,
buttons: {
'Confirm': function (event) {
$(this).dialog('close');
var button = $(this).data("button");
$(button).data("IsConfirmed", true);
button.click();
},
Cancel: function () {
$(this).dialog('close');
}
}
});

//Link or Button click
$(".lkConfirm").data("IsConfirmed", false).bind("click", {}, showConfirmDialog);
});
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: