she*_*nyL 5 jquery jquery-ui z-index jquery-ui-dialog
我有一个显示表格的对话框,当我点击"删除"按钮时,我会弹出另一个对话框要求确认.目前这在第一次工作正常,但如果我第二次单击"删除"按钮,删除对话框将显示在第一个表对话框后面,因此它实际上对用户不可见.
我试图为两个对话框设置z-index,但我不知道它为什么只在第一次工作
以下是我的脚本示例:
// The 1st dialog
var $detaildialog = $('#tableplaceholder').dialog({
autoOpen: false,
modal: true,
width: '800',
height: 'auto'
});
// Some steps to set the url.. then open the dialog
$detaildialog.load(url, function () {
$('#loading').hide();
$detaildialog.dialog('open');
});
// Then, when delete action is called, open the second dialog
fnOnDeleting: function (tr, id, fnDeleteRow) {
var $dialog = $('#checkdeletedialog').dialog({
autoOpen: false,
modal: true,
title: 'Delete Confirmation',
zIndex: 90000
});
$dialog.dialog('open');
}
Run Code Online (Sandbox Code Playgroud)
我在这里做错了什么?
感谢任何帮助..谢谢:)
将第二个对话框的"stack"属性设置为true.
function (tr, id, fnDeleteRow) {
var $dialog = $('#checkdeletedialog').dialog({
autoOpen: false,
modal: true,
stack: true,
title: 'Delete Confirmation'
});
$dialog.dialog('open');
}
Run Code Online (Sandbox Code Playgroud)
更多信息在这里.
编辑:我们也遇到了模式对话框在打开一次后表现奇怪的问题.我们发现在关闭时"破坏"对话框可以解决问题,例如
var $dialog = $('#checkdeletedialog').dialog({
autoOpen: false,
modal: true,
stack: true,
title: 'Delete Confirmation',
close: function() {
$(this).dialog('destroy');
}
});
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
7411 次 |
| 最近记录: |