Home > php教程 > php手册 > DWZ操作成功后的回调方法

DWZ操作成功后的回调方法

WBOY
Release: 2016-06-07 11:43:12
Original
1236 people have browsed it

tp+dwz回调刷新关dialog的方法
/**<br>      * 操作失败的Ajax返回<br>      * @param unknown $navTabId<br>      * @param string $message<br>      * @param string $statusCode<br>      * @param string $callbackType<br>      * @param string $rel<br>      * @param string $forwardUrl<br>      * @param string $type<br>      */<br>     public function ajaxDelReturnFail($message="删除操作失败",$navTabId="",$statusCode="0",$callbackType="",$rel="", $forwardUrl="",$type="JSON")<br>     {<br>         // 保证AJAX返回后也能保存日志<br>         if(C('LOG_RECORD')) Log::save();<br>             <br>         $result  =  array();<br>             <br>         $result['statusCode']  = $statusCode;    // zhanghuihua@msn.com<br>         $result['message'] = $message; // zhanghuihua@msn.com<br>         $result['navTabId']  = $navTabId;    // zhanghuihua@msn.com<br>         $result['rel']  = $rel;    // zhanghuihua@msn.com<br>         $result['callbackType']  =$callbackType;    // zhanghuihua@msn.com<br>         $result['forwardUrl']  =  $forwardUrl;    // zhanghuihua@msn.com<br> <br>         // 返回JSON数据格式到客户端 包含状态信息<br>         header("Content-Type:text/html; charset=utf-8");<br>         exit(json_encode($result));<br> <br>     }<br>     /**<br>      * Ajax删除操作成功<br>      * @param string $message<br>      * @param string $navTabId<br>      * @param string $statusCode<br>      * @param string $callbackType<br>      * @param string $rel<br>      * @param string $forwardUrl<br>      * @param string $type<br>      */<br>     public function ajaxDelReturnSucc($navTabId,$message="删除操作成功",$statusCode="1",$callbackType="",$rel="", $forwardUrl="",$type="JSON")<br>     {<br>         // 保证AJAX返回后也能保存日志<br>         if(C('LOG_RECORD')) Log::save();<br>             <br>         $result  =  array();<br>             <br>         $result['statusCode']  = $statusCode;    // zhanghuihua@msn.com<br>         $result['message'] = $message; // zhanghuihua@msn.com<br>         $result['navTabId']  = $navTabId;    // zhanghuihua@msn.com<br>         $result['rel']  = $rel;    // zhanghuihua@msn.com<br>         $result['callbackType']  =$callbackType;    // zhanghuihua@msn.com<br>         $result['forwardUrl']  =  $forwardUrl;    // zhanghuihua@msn.com<br> <br>         // 返回JSON数据格式到客户端 包含状态信息<br>         header("Content-Type:text/html; charset=utf-8");<br>         exit(json_encode($result));<br> <br>     }<br>     /**<br>      * 操作成功的Ajax返回<br>      * (non-PHPdoc)<br>      * @see Action::ajaxReturn()<br>      */<br>     public function ajaxInsertReturnSucc($navTabId,$message="新增操作成功",$statusCode="1",$callbackType="closeCurrent",$rel="", $forwardUrl="",$type="JSON")<br>     {<br>         // 保证AJAX返回后也能保存日志<br>         if(C('LOG_RECORD')) Log::save();<br>             <br>         $result  =  array();<br>             <br>         $result['statusCode']  = $statusCode;    // zhanghuihua@msn.com<br>         $result['message'] = $message; // zhanghuihua@msn.com<br>         $result['navTabId']  = $navTabId;    // zhanghuihua@msn.com<br>         $result['rel']  = $rel;    // zhanghuihua@msn.com<br>         $result['callbackType']  =$callbackType;    // zhanghuihua@msn.com<br>         $result['forwardUrl']  =  $forwardUrl;    // zhanghuihua@msn.com<br> <br>         // 返回JSON数据格式到客户端 包含状态信息<br>         header("Content-Type:text/html; charset=utf-8");<br>         exit(json_encode($result));<br> <br>     }<br>     /**<br>      * Ajax新增操作失败<br>      * @param unknown $navTabId<br>      * @param string $message<br>      * @param string $statusCode<br>      * @param string $callbackType<br>      * @param string $rel<br>      * @param string $forwardUrl<br>      * @param string $type<br>      */<br>     public function ajaxInsertReturnFail($message="新增操作失败",$navTabId="",$statusCode="0",$callbackType="",$rel="", $forwardUrl="",$type="JSON")<br>     {<br>         // 保证AJAX返回后也能保存日志<br>         if(C('LOG_RECORD')) Log::save();<br> <br>         $result  =  array();<br> <br>         $result['statusCode']  = $statusCode;    // zhanghuihua@msn.com<br>         $result['message'] = $message; // zhanghuihua@msn.com<br>         $result['navTabId']  = $navTabId;    // zhanghuihua@msn.com<br>         $result['rel']  = $rel;    // zhanghuihua@msn.com<br>         $result['callbackType']  =$callbackType;    // zhanghuihua@msn.com<br>         $result['forwardUrl']  =  $forwardUrl;    // zhanghuihua@msn.com<br> <br>         // 返回JSON数据格式到客户端 包含状态信息<br>         header("Content-Type:text/html; charset=utf-8");<br>         exit(json_encode($result));<br> <br>     }<br>     /**<br>      * 操作成功的Ajax返回<br>      * (non-PHPdoc)<br>      * @see Action::ajaxReturn()<br>      */<br>     public function ajaxUpdateReturnSucc($navTabId,$message="更新操作成功",$statusCode="1",$callbackType="closeCurrent",$rel="", $forwardUrl="",$type="JSON")<br>     {<br>         // 保证AJAX返回后也能保存日志<br>         if(C('LOG_RECORD')) Log::save();<br>             <br>         $result  =  array();<br>             <br>         $result['statusCode']  = $statusCode;    // zhanghuihua@msn.com<br>         $result['message'] = $message; // zhanghuihua@msn.com<br>         $result['navTabId']  = $navTabId;    // zhanghuihua@msn.com<br>         $result['rel']  = $rel;    // zhanghuihua@msn.com<br>         $result['callbackType']  =$callbackType;    // zhanghuihua@msn.com<br>         $result['forwardUrl']  =  $forwardUrl;    // zhanghuihua@msn.com<br> <br>         // 返回JSON数据格式到客户端 包含状态信息<br>         header("Content-Type:text/html; charset=utf-8");<br>         exit(json_encode($result));<br> <br>     }<br>     /**<br>      * Ajax新增操作失败<br>      * @param unknown $navTabId<br>      * @param string $message<br>      * @param string $statusCode<br>      * @param string $callbackType<br>      * @param string $rel<br>      * @param string $forwardUrl<br>      * @param string $type<br>      */<br>     public function ajaxUpdateReturnFail($message="更新操作失败",$navTabId="",$statusCode="0",$callbackType="",$rel="", $forwardUrl="",$type="JSON")<br>     {<br>         // 保证AJAX返回后也能保存日志<br>         if(C('LOG_RECORD')) Log::save();<br>         $result  =  array();<br>         $result['statusCode']  = $statusCode;    // zhanghuihua@msn.com<br>         $result['message'] = $message; // zhanghuihua@msn.com<br>         $result['navTabId']  = $navTabId;    // zhanghuihua@msn.com<br>         $result['rel']  = $rel;    // zhanghuihua@msn.com<br>         $result['callbackType']  =$callbackType;    // zhanghuihua@msn.com<br>         $result['forwardUrl']  =  $forwardUrl;    // zhanghuihua@msn.com<br> <br>         // 返回JSON数据格式到客户端 包含状态信息<br>         header("Content-Type:text/html; charset=utf-8");<br>         exit(json_encode($result));<br> <br>     }

AD:真正免费,域名+虚机+企业邮箱=0元

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template