easy-ui使用记录——windows窗体、子父页面值传递

楔子

简单的使用记录。使用Windows窗体打开一个页面,选择数据传递给父页面。并关闭子页面

父页面打开窗体

父页面div和js
 <div id="winSelectJsp"></div>
 //使用这用方式,父页面的可以执行
function selectSource(){
    $('#winSelectJsp').window({    
        title:'选择- 源字典',      
        width:950,    
        height:500,        
        modal:true,
        draggable : false,
        shadow: true,
        content:"<iframe src='${basePath}/view/qyzx/ywgn/dic/selectDic.jsp'   height='100%' width='100%' frameborder='0px' ></iframe>"
    });
}

子页面操作

子页面传递值给父页面

    /* 添加数据字典对照 */
function btn_add(){
    var row = $('#grid').datagrid("getSelected");
    if(row==null){
        $.messager.alert('消息',   '该操作有且只能选择一条记录!' ,'question');
        return false;
    }else{
    if(row.dicitemstatus == '2'){
        $.messager.alert('消息', '该状态为未启用 请勿选择 !','question');
        return false;
    }

    parent.$("#sourcedictypeshow").textbox("setValue" ,parent.parent.parent.formartDic($("#dictype").textbox("getValue"),"1205")); 
    parent.$("#sourcedictype").val($("#dictype").textbox("getValue") ); 
    parent.$("#sourcediccode").textbox("setValue" ,$("#diccode").textbox("getValue")); 
    parent.$("#sourcedicname").textbox("setValue" ,$("#dicname").textbox("getValue")); 
    parent.$("#sourcedicitemcode").textbox("setValue",row.dicitemcode);
    parent.$("#sourcedicitemname").textbox("setValue",row.dicitemname);
    parent.$("#sourceDiitemid").val(row.id);

    $('#grid').datagrid('clearSelections');
    parent.$('#winSelectJsp').window("close");  
    }
} 
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值