Pass the value of the child page to the parent page in easyUI

//Click the select button, load and jump to the sub page, and load the data
function choose()
{
openWinW2('<%=basePath %>recall/gotoBatch.xhtml?prodcode='+$("#prodcode").textbox( "getValue"),
     "Product batch query","650px","350px",false,false);
}
List of subpages

$('#tt').datagrid({
url: '<%=basePath %> recall/queryProdbatchList.xhtml',
queryParams: data_attr,
singleSelect: true,
rownumbers: true,
pagination: true,
pageNumber: 1,
pageSize:10,
columns:[[
{field:'detail_id',title:'Product batch', align:'center',width:100,hidden:'true'},
{field:'prodbatch',title:'product batch',align: 'center',width:100},
{field:'prodname',title:'product name',align:'center',width:100},
{field:'custentid',title:'客户企业ID',align:'center',width:100},
{field:'custentname',title:'客户企业名称',align:'center',width:100},
{field:'prodmodel',title:'规格',align:'center',width:100},
{field:'salesamount',title:'产品数量',align:'center',width:100},
{field:'detailid',title:'操作',halign:'center',align:'center',width:100,
           formatter: function (value, rowData, rowIndex) {
           return "<a href='javascript:void(0)' onclick=\" chooseBack ('"+rowData.prodbatch+"','"+rowData.custentid+"','"+rowData.custentname+"','"+rowData.prodmodel+"','"+rowData.salesamount+"')\">select</a>" -- pass value}); ]]            }
           }






function chooseBack(prodbatch,custentid,custentname,prodmodel,salesamount){
window.parent.selectBatch(prodbatch,custentid,custentname,prodmodel,salesamount);
window.parent.closeWin("产品批次查询");

} --父页面接收 function selectBatch(prodbatch,custentid,custentname,prodmodel,salesamount){ $("#prodbatch").textbox("setValue",prodbatch); $("#cust_ent_id").val(custentid); $("#cust_ent_name").textbox("setValue",custentname); $("#prodmodel").textbox("setValue",prodmodel); $("#recallamount").textbox("setValue",salesamount); }










Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326200707&siteId=291194637