【发布时间】:2011-03-28 15:24:19
【问题描述】:
我有一个使用以下代码的 jquery 数据表:
// Test list table
$('#dashboard_testlist_table').dataTable({
"bJQueryUI": true,
"bAutoWidth": false,
"bProcessing": true,
"aaSorting": [[0, 'asc'], [2, 'asc']],
"sPaginationType": "full_numbers",
"sAjaxSource": projectTestListTablePopulateUrl,
"oLanguage": {
"sSearch": "Search all columns:"
},
"aoColumns": [{
"sTitle": "Protocol/Test/Case"
}, {
"sTitle": "Last Run"
}, {
"sTitle": "Last Build/Phase"
}, {
"sTitle": "Detail",
"sClass": "center"
}, {
"sTitle": "Owner"
}]
});
我的服务器正确地发回 JSON 并且表格按预期填充。
我遇到的问题是我无法在我的表中进行任何过滤。搜索框中的任何字符都会立即过滤为不显示任何结果。我用过很多数据表,这个让我抓狂。
我注意到当我“查看页面源代码”时,源代码中没有呈现的 html。这是我的原始 HTML:
<!--Test List Table-->
<table id="dashboard_testlist_table" class="display">
<!--Table Header-->
<thead>
<tr>
<th>Protocol/Test/Case</th>
<th>Last Run</th>
<th>Last Build/Phase</th>
<th>Detail</th>
<th>Owner</th>
</tr>
</thead>
<tbody>
<!--Table Body, ajax populated, see /media/custom_js/user_dashboard.js -->
</tbody>
</table>
页面加载后,仍然显示相同。发送的 JSON 数据是否应该填充在那里?
否则,是否有人对过滤此数据时首先要查找的内容有任何建议?我正在使用 jquery 数据表 1.6.2。
【问题讨论】:
标签: jquery ajax datatables