artdialog中刷新父窗口的三种方式

1.真刷新但不会停留在本页面

var win = art.dialog.open.origin;
win.location.reload();

2.重新提交父窗口

var win = art.dialog.open.origin;
$("#queryTask", win.document).trigger("click");

3.假刷新会停留在本窗口

<pre name="code" class="javascript">
/**
 * 删除一行数据,并把序号和总数减1
 * @param trId
 */
function setPageNum(trId) {
	// 开打dialog的原始页面
	var win = art.dialog.open.origin;
	// 删除一行html
	$("#" + trId, win.document).remove();
	// 对表格id='list_table'的tbody中的tr的每一列重新设置序号
	$("#list_table tbody tr", win.document).each(function(index, item) {
		$(this).find("td:eq(0)").text(index + 1);
	});
	// 获取第二个class=‘pagetotal’的元素
	var total = $(".pagetotal:eq(1)", win.document);
	var pageNum = total.text().split("/");
	// 重新设置数据总数
	total.text(pageNum[0] + "/" + (parseInt(pageNum[1]) - 1));
}

4.通过ID关闭art.dialog

top.art.dialog({id : id}).close();

5.对art.dialog.data(“isSuccess”, true)传输数据的要注意的地方就是用完之后必须重置,否则全局都能获取到这个值

版权声明:本文为CSDN博主「steveguoshao」的原创文章,遵循CC 4.0 by-sa版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/steveguoshao/article/details/41803599

猜你喜欢

转载自blog.csdn.net/weixin_41377835/article/details/99655033
今日推荐