作者:talhon 回眸@浅笑 本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,否则保留追究法律责任的权利。
软件开发技术交流,同学习共进步,欢迎加群, 群号:169600532
navTab的刷新在doc文件里也有说明
首先 在form表单里指定好回调函数
*
function navTabAjaxDone(json){ DWZ.ajaxDone(json); //注意返回的JSON的数据结构 if (json.statusCode == DWZ.statusCode.ok){ if (json.navTabId){ //把指定navTab页面标记为需要“重新载入”。注意navTabId不能是当前navTab页面的 navTab.reloadFlag(json.navTabId); } else { //重新载入当前navTab页面 navTabPageBreak(); } if ("closeCurrent" == json.callbackType) { setTimeout(function(){navTab.closeCurrentTab();}, 100); } else if ("forward" == json.callbackType) { navTab.reload(json.forwardUrl); } } } 框架的回调函数使用在dialog,navTab 上 如果有特殊的需求可以自己写个Ajax实现在回调函数中 使用 navTabPageBreak() ; 就可以刷新当前的navTab 当然也可以实现局部刷新 相见 navTabPageBreak() ; dwzPageBreak() 函数说明
<div class="page" id="page<%=NameSpace %>"> <form id="formGongGao" runat="server" method="post" class="pageForm" action="/Ajax/Hanlder/GongGaoEntry.ashx?method=EditGongGao" onsubmit="return iframeCallback(this,navTabGGInfoAjaxDone);"> <label valign="middle" style="border-bottom: #006633 1px dashed; height: 30px; font-weight:bold;"> <img align="absMiddle" border="0" src="../Images/BanKuaiJianTou.gif" /> 公告信息</label> <div class="divider" style="border-color: transparent;"></div> <script type="text/javascript"> var NS_<%=NameSpace %> = new Object(); NS_<%=NameSpace %>.advanceSearch = function () { var form = document.getElementById("formGongGao"); navTabSearch(form); }; $(function (){ if(<%=ReadOnly %>=="0"){ $("#page<%=NameSpace %> #formGongGao input").attr("readonly", "readonly"); $("#page<%=NameSpace %> #formGongGao textarea").attr("readonly", "readonly"); $("#page<%=NameSpace %> #divUpload").hide(); $("#page<%=NameSpace %> #formGongGao #btnS").hide(); } }); function doReflush() { $("#areaselecter").contents().find("body").empty(); //__doPostBack('btnReflush', ''); navTab.reloadFlag("GongGaoInfo"); }; function hideUploadWin() { $("#areaselecter").contents().find("body").empty(); hide(); }; function openUploadWin() { $("#areaselecter").attr("src", '/GongGao/DocUpload.aspx?conid=<%=CurrentGongGao.GGID %>'); pop(); return false; }; navTabGGInfoAjaxDone = function (json) { DWZ.ajaxDone(json); if (json.statusCode == DWZ.statusCode.ok) { navTab.reloadFlag("XZ_FBGG"); navTab.reloadFlag("CKGG"); //navTabPageBreak(); } navTabAjaxDone(json); }; function delAjaxDoneThis(json) { DWZ.ajaxDone(json); if(json.statusCode==DWZ.statusCode.ok){ //navTabPageBreak();//用这个好像不起作用,我当前页面navTabid="GongGaoInfo"; navTab.reloadFlag("GongGaoInfo"); } } </script> <div id="choose-box-wrapper" style="z-index:1000"> <div id="choose-box"> <div id="choose-box-title"> <span>上传公告附件</span> </div> <div id="choose-box-container"> <iframe id="areaselecter" width="100%" name="selector" scrolling="no" frameborder="0"></iframe> </div> <div id="choose-box-bottom"> <input type="button" id="btnColse" class="smallbtn" onclick="hideUploadWin()" value="关闭" style="margin:5px;" /> </div> </div> </div> <div class="pageFormContent" layouth="80"> <table class="commontable" style="width:80%;" cellpadding="0" cellspacing="0"> <tr> <td> 公告标题:</td> <td style="text-align:left;"><input type="hidden" name="GGID" value="<%=CurrentGongGao.GGID %>" /> <input type="text" name="GTitle" size="50" value="<%=CurrentGongGao.GTitle%>" class="required" /> </td></tr> <tr> <td>正 文:</td> <td style="text-align:left;"><textarea cols="100" name="GContent" rows="10"><%=CurrentGongGao.GContent%></textarea></td> </tr> <tr> <td>创建人:</td> <td style="text-align:left;"><input type="text" name="CreatorName" size="30" value="<%= CurrentGongGao.CreatorName %>" readonly="readonly" /></td> </tr> <tr> <td>创建时间:</td> <td style="text-align:left;"><input type="text" name="CreateTime" size="30" value="<%=StringHelper.FormatDate(CurrentGongGao.CreateTime) %>" readonly="readonly" /></td> </tr> <tr> <td>附件:</td> <td style="text-align:left;"> <div id="DocDiv" runat="server"><table ID="gvList" cellspacing="0" class="commontable" rules="all" style="border-width:0px;width:80%;border-collapse:collapse;"> <tr> <th align="center" scope="col" style="width:50px;"> 序号</th> <th align="center" scope="col"> 附件名称</th> <th align="center" scope="col" style="width:260px;"> 编辑</th> </tr> <asp:Repeater ID="rpOtherDocs" runat="server" onitemdatabound="rpOtherDocs_ItemDataBound"> <ItemTemplate> <tr> <td align="center"> <%# Eval("No").ToString()%> </td> <td align="center"> <%# Eval("DocName").ToString()%> </td> <td align="center"> <asp:Label ID="lbDownload" runat="server" Text=""><a href='/Ajax/Hanlder/DownloadHandler.ashx?type=gonggaofile&id=<%=CurrentGongGao.GGID %>&no=<%# Eval("No") %>' class="navDone">下载</a></asp:Label> <asp:Label ID="lbDet" runat="server" Text=""><a href='/Ajax/Hanlder/GongGaoEntry.ashx?method=Delfile&id=<%=CurrentGongGao.GGID %>&no=<%# Eval("No") %>' class="navDone" target="ajaxTodo" callback="delAjaxDoneThis" fresh="true" title="确定要删除吗?">删除</a></asp:Label> </td> </tr> </ItemTemplate> </asp:Repeater> </table> </div> <div id="noDocDiv" runat="server"></div> </td> </tr> </table> <div id="divUpload"> <table class="commontable" style="width:80%;" cellpadding="0" cellspacing="0"> <tr> <td class="lblfield2">上传附件</td> <td class="valuefield2"> <asp:Button ID="btnUploadOther" runat="server" Text="上传" CssClass="smallbtn" OnClientClick="return openUploadWin();" /> </td> </tr> </table> </div> </div> <div id="btnS" class="formBar"> <div class="buttonActive"> <div class="buttonContent"> <button type="submit">保 存</button> </div> </div> </div> </form> </div>
注意事项:首先该页面没有html,head及body标签
在删除按钮时,给它callback="delAjaxDoneThis" ,定义删除后,重新刷新当前页面