【发布时间】:2012-09-01 18:58:16
【问题描述】:
在使用 UI 对话框时如何设置 info_dialog 的 z-index?
【问题讨论】:
标签: jqgrid
在使用 UI 对话框时如何设置 info_dialog 的 z-index?
【问题讨论】:
标签: jqgrid
$.jgrid.info_dialog 在内部使用$.jgrid.createModal,它使用了$.jgrid.jqModal(见the line),这是不久前引入的(见我的建议here)。所以你可以做类似的事情
$.jgrid.jqModal = $.extend($.jgrid.jqModal || {}, {
zIndex: 1234
});
由于navGrid的另一个参数,你必须额外添加
$.extend($.jgrid.nav, {
alertzIndex: 1234
});
使$.jgrid.jqModal.zIndex 设置工作。
更新:您可以通过任何方式使用$.jgrid.info_dialog 的“子类化”(例如the answer)。对应的代码如下:
var oldInfoDialog = $.jgrid.info_dialog;
$.extend($.jgrid,{
info_dialog: function (caption, content, c_b, modalopt) {
if (modalopt && (modalopt.zIndex === null || modalopt.zIndex === undefined ||
(typeof modalopt.zIndex === "number" && modalopt.zIndex < 1234))) {
modalopt.zIndex = 1234;
}
return oldInfoDialog.call (this, caption, content, c_b, modalopt);
}
});
【讨论】: