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