Three ways to refresh the parent window in artdialog

1. Really refresh but will not stay on this page

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

2. Resubmit the parent window

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

3. False refresh will stay in this window

<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. Close art.dialog by ID

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

5. The thing to pay attention to when transferring data to art.dialog.data(“isSuccess”, true) is that it must be reset after use, otherwise this value can be obtained globally

Copyright statement: This article is an original article by CSDN blogger "steveguoshao", and follows the CC 4.0 by-sa copyright agreement. For reprinting, please attach the original source link and this statement.
Original link: https://blog.csdn.net/steveguoshao/article/details/41803599

Guess you like

Origin blog.csdn.net/weixin_41377835/article/details/99655033