1. 程式人生 > >easyUI 子視窗關閉 父視窗重新整理

easyUI 子視窗關閉 父視窗重新整理

子視窗寫法:

  function loadPsg4Wel(rec) {
    enableCmp('L');
    $('#btn_j').hide();
    $('#btn_save').hide();
    rec.lclDptDate = rec.lclDptDate.split(" ")[0];
    rec.std = rec.lclDptDate + ' ' + rec.stdStr + ":00";
    $("#vipForm").form('load', rec);
    getVipPaxInfo();
};
$.post(ctx + '/yourAction'
, trimFieldValue(params), function(data) { loading.close(); if (data.status == 1) {// 操作成功 /*$.messager.alert('提示:', '', 'info'); cancel();*/ $.messager.confirm('操作成功', '您確定關閉當前視窗並重新整理父視窗?'
, function(r) { if (r) { if(window.parent!=window){ console.log("子視窗"); cancel(); window.parent.location.reload(true); } } }); } else
{ $.messager.alert('提示', data.object, 'warning', function() { $("#bordCardCode").focus(); }); } });

父視窗寫法:

$("#MyPopWindow").window({
                title : '父視窗新增子頁面資訊',
                href : ctx + '/jsp/winPage/childPage.jsp',
                width : 850,
                height : 525,
                iniframe : true,
                onLoad : function() {
                    loadPsg4Wel(obj);
                }
            });