一、window.open() 打开的子页面给父级页面传值
1. 父级页面打开子页面
function add_onclick(){
var URL= CTX + "/eformsys/fceform/common/djframe.htm?newWindow=true&djsn=1602669771000&opentype=1&djtype=TT";
window.open(URL, "选择图书编号", "top:10%;left:10%;dialogwidth:300px; dialogheight:200px; center:yes; Help:No; Resizable:No; Status:Yes; Scroll:Yes; Status:no; resizable:no ");
}
2. 子页面返回值给父页面
function edit_onclick(){
var groupNo= dataset1.Fields.Field['groupNo'].Value;
window.parent.opener.document.getElementById("tzbh").value = groupNo;
$eform('关闭窗口')
}
二、window.showModalDialog() 打开的子页面给父级页面传值
1. 父级页面打开子页面
function add_onclick(){
var URL= CTX + "/eformsys/fceform/common/djframe.htm?newWindow=true&djsn=1504490198000&opentype=1&djtype=TT";
var RtrValue = window.showModalDialog(URL, "新建图书", "dialogwidth:800px; dialogheight:600px; center:yes; Help:No; Resizable:No; Status:Yes; Scroll:Yes; Status:no; resizable:no ");
if(RtrValue!=null){
alert(RtrValue);
search();
}
}
2. 子页面返回值给父页面
function add(){
var groupNo= dataset1.Fields.Field['groupNo'].Value;
window.returnValue=groupNo;
$eform('关闭窗口')
}