1
我的页面中有许多jqgrid。弹出警报模式窗口(“警告请选择一行”)始终显示在顶部。我希望模态窗口出现在生成编辑事件的JQGrid的旁边。 我能得到这个工作的唯一方法是将JQGrid源代码更改为以下内容。JQGrid AlertMod警告消息的位置
//Line number 7866
if (o.edit) {
tbd = $("<td class='ui-pg-button ui-corner-all'></td>");
pEdit = pEdit || {};
$(tbd).append("<div class='ui-pg-div'><span class='ui-icon "+o.editicon+"'></span>"+o.edittext+"</div>");
$("tr",navtbl).append(tbd);
$(tbd,navtbl)
.attr({"title":o.edittitle || "",id: pEdit.id || "edit_"+elemids})
.click(function(){
if (!$(this).hasClass('ui-state-disabled')) {
var sr = $t.p.selrow;
if (sr) {
if($.isFunction(o.editfunc)) {
o.editfunc(sr);
} else {
$($t).jqGrid("editGridRow",sr,pEdit);
}
} else {
$.jgrid.viewModal("#"+alertIDs.themodal,{gbox:"#gbox_"+$t.p.id,jqm:true});
//***********
//Added this to change the location of the Warning Alert window
//Line number 7883
$("#alertmod")[0].style.top =$("#gbox_"+$t.p.id)[0].offsetTop;
//***********
$("#jqg_alrt").focus();
}
}
return false;
有没有一种更简单的方法来实现这一点,而无需修改src代码。