dwz如何在关闭dialog后刷新之前的页面

universeL 发布于 2014/11/24 16:33
阅读 5K+
收藏 1
点击添加链接弹出添加框,连接如下
<li><a class="add" href="access_addqx.jsp" target="dialog"  rel="firstDialogId" ><span>添加</span></a></li>

弹出的窗口如下:

点击保存之后,关闭弹窗,那么问题来了,关闭弹窗之后,怎么刷新之前的页面呢?

添加表单的代码:

<form method="post" action="addFile.action" class="pageForm required-validate" onsubmit="return validateCallback(this, dialogAjaxDone);">



js代码:

function dialogAjaxDone(json){
	DWZ.ajaxDone(json);
	if (json.statusCode == DWZ.statusCode.ok){
		if (json.navTabId){
			navTab.reload(json.forwardUrl, {navTabId: json.navTabId});
		} else if (json.rel) {
			var $pagerForm = $("#pagerForm", navTab.getCurrentPanel());
			var args = $pagerForm.size()>0 ? $pagerForm.serializeArray() : {}
			navTabPageBreak(args, json.rel);
		}
		if ("closeCurrent" == json.callbackType) {
			$.pdialog.closeCurrent();
		}
	}
}

function navTabPageBreak(args, rel) {
	dwzPageBreak({
		targetType : "navTab",
		rel : rel,
		data : args
	});
}

function dwzPageBreak(options) {
	var op = $.extend({
		targetType : "navTab",
		rel : "",
		data : {
			pageNum : "",
			numPerPage : "",
			orderField : "",
			orderDirection : ""
		},
		callback : null
	}, options);
	var $parent = op.targetType == "dialog" ? $.pdialog.getCurrent() : navTab
			.getCurrentPanel();

	if (op.rel) {
		var $box = $parent.find("#" + op.rel);
		var form = _getPagerForm($box, op.data);
		if (form) {
			$box.ajaxUrl({
				type : "POST",
				url : $(form).attr("action"),
				data : $(form).serializeArray(),
				callback : function() {
					$box.find("[layoutH]").layoutH();
				}
			});
		}
	} else {
		var form = _getPagerForm($parent, op.data);
		var params = $(form).serializeArray();

		if (op.targetType == "dialog") {
			if (form)
				$.pdialog.reload($(form).attr("action"), {
					data : params,
					callback : op.callback
				});
		} else {
			if (form)
				navTab.reload($(form).attr("action"), {
					data : params,
					callback : op.callback
				});
		}
	}
}



服务端返回的代码:
"{\"statusCode\":\"200\", \"message\":\"" + msg+ "\"," + "\"navTabId\":\"firstDialogId\", \"rel\":\"firstDialogId\", \"callbackType\":\"closeCurrent\",\"forwardUrl\":\""+ url + "\"}"



求大神帮忙解答,万分感谢!




加载中
0
net ljx
net ljx
返回的参数:navTabId,设置需要刷新的窗体即可自动刷新请求
返回顶部
顶部