问题描述
我感觉自己快疯了。已经和同事一起做这件事好几天了。我们在 Intranet 站点上有一个 DIV,它正在使用 load 函数加载其内容以抓取包含空白表的第二页(结构存在但 Tbody 最初不包含任何内容。在 load 的回调函数中进一步的 get 用于从第三页拉入表格行:
<div class="AlwaysOpenContentDocs" id="Ref_Doc_Lib">
<script type='text/javascript'>
$("#Ref_Doc_Lib").load("./Documents/Docs_View_Edit_new.asp",function() {
//Initiate the table sort jquery plugin on the table
$('#Docs_Library_Table').tablesorter({
namespace : 'Docs_Library_Table',widgets : ['zebra','filter','stickyHeaders'],usNumberFormat : false,sortReset : true,sortRestart : true
});
$.get("./Documents/Docs_View_Table_Data.asp",function(html) {
$("#Docs_Library_Table tbody").append(html).trigger("updateAll");
});
});
</script>
</div>
这行得通,表被初始化,新行按预期插入到 tbody 中。
问题是更新所有功能似乎不起作用。我更新了 jquery.tablesorter.js 文件以将控制台日志行添加到 update all 函数中,但它从未被执行过,所以我确信调用该函数的行没有正确执行,但我一生都无法弄清楚为什么.
同样有趣的是,在代码中的那一行代码中,新行应用了它们的样式,并且它们仍然是白色行(不是斑马线),但是在测试搜索或排序时,它的行为就像它仍然只是初始空表一样。
两个外部文件的内容如下: Docs_View_Edit_new.asp
<table class="tablesorter" id="Docs_Library_Table" >
<thead>
<tr class="AddReportTableText">
<th style="width:200px;">Document Name</th>
<th style="width:200px;">Document Type</th>
<th style="width:400px;">Description</th>
<th style="width:200px;">TRIM Reference</th>
<% If bAuth_Views_Admin_Docs = True Or bAuth_Buttons_Global_Admin_All = True Then %>
<th>Action</th>
<% End If %>
</tr>
</thead>
<tbody>
</tbody>
<table>
Docs_View_Table_Data.asp:
<tr class="AddReportTableText" style="width:200px;">
<td>
<b><% response.write objrs.fields.item(1).value %></b>
</td>
<td>
<% response.write objrs.fields.item(2).value %>
</td>
<td style="width:400px;">
<div id="disp-desc-<% response.write objrs.fields.item(0).value%>" style="display:block;"><% response.write objrs.fields.item(3).value %></div>
</td>
<td>
<div id="disp-TRIM-<% response.write objrs.fields.item(0).value%>" style="width:100%; text-align:center; display:block;">
<a href="http://pdcwpbvrs200/Dashboard_Files/Admin_Reference_Docs/<% response.write objrs.fields.item(5).value %>"><% response.write objrs.fields.item(4).value %></a>
</div>
</td>
<% If bAuth_Views_Admin_Docs = True Or bAuth_Buttons_Global_Admin_All = True Then %>
<td>
<center><input type="button" class="defaultFont" id="btn-nf-edit-<% response.write objrs.fields.item(0).value%>" value="Delete" style="width: 70px; display:block;" onclick="AdminDocs_btn_nf_click('Delete','<% response.write objrs.fields.item(0).value %>')"></input></center>
</td>
<% End If %>
</tr>
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)