我有一个jquery使用下面的代码数据表:麻烦过滤通过Ajax的填充数据与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。