父級頁面
function add(id){
$.jBox.open("iframe:${ctx}/organize/tOrganizeOutlayInfo/add?outlayId="+id, "新增明細信息", 780, 300,{ buttons: { '保存':'save','關閉': true},
/* closed:function (){
//在彈出窗口頁面,如果我們保存了數據,就將父頁面裏的變量isFreshFlag 值設置爲2
if(isFreshFlag==2){
location.reload();
}
} */
submit: function (v, h, f) {
if(v=='save'){
var iframeName = h.children(0).attr("name");
var iframeHtml = window.frames[iframeName]; //獲取子窗口的句柄
iframeHtml.save();//子窗口的函數
}
}
}
);
}
子頁面
function save(urlNew){
$.ajax({
cache: true,
type: "POST",
url:'${ctx}/organize/tOrganizeOutlayInfo/save',
data:$(inputForm).serialize(),
async: false,
success: function(date){
top.$.jBox.tip("保存成功");
// window.parent.window.isFreshFlag="2";//回寫父頁面的值
//window.parent.window.elisorId=date;//回寫父頁面的值
parent.location.reload();
// parent.window.location.reload();
}
});
}
學習記錄:http://www.5imvc.com/scripts/jbox/jbox-demo.html
http://blog.csdn.net/qq_14984307/article/details/51199391