DWZ 表单提交 自定义回调 刷新问题
- HTML:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30<form method="post" th:action="@{'sys/detamgup/add_save/'+${nti}}" class="pageForm required-validate" onsubmit="return validateCallback(this, customDialogAjaxDone);">
<div class="pageFormContent nowrap" layoutH="56">
<input type="hidden" th:value="${deptId}" name="deptId">
<input type="hidden" th:value="${teamGroupId}" name="teamGroupId">
<dl style="margin-bottom: 10px;">
<dt th:text="#{TEXT_START_TIME}">StartTime:</dt>
<dt>
<input class="required date" dateFmt="yyyy-MM-dd" name="startTime" style="width:150px;" type="text" readonly="readonly" value="" />
</dt>
</dl>
<dl style="margin-bottom: 10px;">
<dt th:text="#{TEXT_END_TIME}">EndTime:</dt>
<dt>
<input class="date" dateFmt="yyyy-MM-dd" name="endTime" style="width:150px;" type="text" readonly="readonly" value="" />
</dt>
</dl>
<dl style="margin-bottom: 10px;">
<dt th:text="#{TEXT_PHONE}">TEL:</dt>
<dt>
<input class="required jscheck" name="tel" type="text" style="width:150px;" maxlength="30" value="" />
</dt>
</dl>
</div>
<div class="formBar">
<ul>
<li><div class="buttonActive"><div class="buttonContent"><button type="submit"> Save</button></div></div></li>
</ul>
</div>
</form> - JS
1
2
3
4
5
6
7
8
9
10
11
12
13function customDialogAjaxDone(json){
alertMsg.correct()
if(json.statusCode==200){
//自定义模块
$(".refreshDataByDialog").click();
alertMsg.correct(json.message)
$.pdialog.closeCurrent();
}else {
dialogAjaxDone(json);
}
} - 按钮处理:
1
<li><a class="delete" th:href="@{'sys/emp_delete?id={employeeId}target="ajaxTodo" callback="dialogAjaxDoneThis" title="确定删除?">Delete</a></li>
1
2
3
4
5
6
7
8function dialogAjaxDoneThis(json) {
DWZ.ajaxDone(json);
if(json.statusCode==DWZ.statusCode.ok){
if(json.navTabId){
navTab.reload(json.forwardUrl,json.navTabId);
}
}
return false;
DWZ 表单提交 自定义回调 刷新问题
http://yoursite.com/post/f5f1c84b.html/