0
我想在用户点击下面模式中的“取消”按钮时添加提示。 它会提示他们确认该操作。下面的代码是我目前尝试的。确认模式按钮的动作asp.net
function ShowAddEditExecutive() {
$("#addEditExecutive").dialog({
modal: true,
width: 800,
appendTo: "form",
open: function() {
$(this).dialog("widget").find(".ui-dialog-titlebar").show();
// Removes the do you want to leave this page dialog.
window.onbeforeunload = null;
// The two isplalines below are 2 different ways to ensure the
// background is completely grayed out if the modal is larger
// then the page. The first was chosen so that the scroll
// bars are not disabled.
$('.ui-widget-overlay').css('position', 'fixed');
//$('body').css('overflow', 'hidden');
},
buttons: {
"Add/Edit Executive Information": function() {
$("[id*=btnAddEditExecutive]").click();
},
"Cancel": function() {
$(this).dialog("close");
}
},
close: function (ev, ui) {
// Ensures when you cancel that the values are not retained.
$(this).remove();
// The two lines below are 2 different ways to ensure the
// background is completely grayed out if the modal is larger
// then the page. The first was chosen so that the scroll
// bars are not disabled.
$('.ui-widget-overlay').css('position', 'absolute');
//$('body').css('overflow', 'inline');
},
});
}
代码有什么问题? – Kyojimaru 2014-09-05 16:37:39
这段代码没有问题,我试图让“取消”按钮产生一个确认窗口。 – 2014-09-05 16:58:53