jquery ui - 嵌套对话框 z 索引问题
我收到一个显示表格的对话框,当我单击“删除”按钮时,我会弹出另一个对话框以要求确认。目前,第一次工作正常,但如果我第二次单击“删除”按钮,删除对话框将显示在第一个表对话框的后面,因此用户实际上看不到它。
我尝试为两个对话框设置 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');
}
我在这里做错了什么吗?
感谢任何帮助..谢谢:)
I got a dialog which showing a table, and when i click on a "Delete" button, I will pop up another dialog to ask for confirmation. Currently this works fine at the first time, but if I click the "Delete" button for the second time, the delete dialog is shown behind the first table dialog, so it is actually invisible to the user.
I tried to set the z-index for both dialog, but I don't know why it is only working at the first time
Following is the sample of my script:
// 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');
}
Anything I am doing wrong here?
Appreciate any help.. thanks :)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
将第二个对话框的“stack”属性设置为 true。
更多信息请参见此处。
编辑:我们还遇到过模式对话框在打开一次后行为异常的问题。我们发现在关闭对话框时“销毁”对话框可以解决该问题,例如
Set the "stack" property of the second dialog to true.
More information here.
EDIT: We've also had issues with modal dialogs behaving oddly after opening once. We found that 'destroying' the dialog when it closes fixes the issue, e.g.