2012-09-01 26 views

回答

2

$.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); 
    } 
}); 
+0

部分是好的,但在editrules使用时无法正常工作 –

+0

@DavidO:你应该更准确地描述你的问题。您没有指定您使用的*编辑模式*。如果你使用表单编辑,你应该没有问题与数据的验证。我同意,jqGrid在转发'zIndex'时遇到问题。如何解决问题有很多选择。可以修改一行jqGrid代码([here](https://github.com/tonytomov/jqGrid/blob/v4.4.1/js/grid.common.js#L204)或[here](https:// github.com/tonytomov/jqGrid/blob/v4.4.1/js/grid.common.js#L194))或覆盖'info_dialog'方法,并用'zIndex'设置调用原始的方法。 – Oleg

+0

我有:{name:'procent',index:'procent',width:70,align:'center',editable:true,editrules:{required:true}},当字段“procent”为空时,info_dialog出现,但Z指数是1000,并在UI对话后面 –