最近在用easyui,在使用过程中,选项卡使用的是<iframe />引入页面,但是,当我在使用Dialog的时候,只是在这个子选项卡中弹出,如果想让它在整个页面中弹出,就要在父页面中进行打开Dialog。
解决方法:
在父页面中定义打开Dialog函数
/*
在父页面打开Dialog
*/
function openDlg(){
$('#userDialog').dialog('open');
}
在子页面中进行调用
$("#add").click(function() {
parent.openDlg();
});
补充:
在父页面中如何调用子页面函数?
<ifame />
子页面中函数
function reloadGrid(){
$("#userGrid").datagrid("reload");
}
<iframe name="childframe"/>
父页面中调用
childframe.window.reloadGrid();
childframe为我们定义的<iframe />中的name值。
本文介绍了在使用easyui时,如何处理Dialog只在子选项卡中弹出的问题,提供了解决方法:在父页面定义打开Dialog的函数,并在子页面中调用该函数。同时探讨了父页面如何调用子页面函数的操作步骤。
1254





