DWZ 表单提交 自定义回调 刷新问题

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/qq_31482599/article/details/83060670

HTML:

  <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">&nbsp;&nbsp;Save</button></div></div></li>
        
      </ul>
    </div>
  </form>

JS

function customDialogAjaxDone(json){
    alertMsg.correct()
    if(json.statusCode==200){

        //自定义模块

        $(".refreshDataByDialog").click();
        alertMsg.correct(json.message)
        $.pdialog.closeCurrent();
    }else {
        dialogAjaxDone(json);
    }
}

 

按钮处理:

HTML

<li><a class="delete" th:href="@{'sys/emp_delete?id={employeeId}target="ajaxTodo"  callback="dialogAjaxDoneThis"  title="确定删除?">Delete</a></li>

JS

function dialogAjaxDoneThis(json) {
    DWZ.ajaxDone(json);
    if(json.statusCode==DWZ.statusCode.ok){
        if(json.navTabId){
            navTab.reload(json.forwardUrl,json.navTabId);
        }
    }
    return false;
}

 

展开阅读全文

没有更多推荐了,返回首页