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

来源:互联网 发布:windows软件性能测试 编辑:程序博客网 时间:2024/06/08 04:36
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)传输数据的要注意的地方就是用完之后必须重置,否则全局都能获取到这个值


2 0
原创粉丝点击