我尝试使用jquery数据表的columnFilter插件,但无法运行它。 我已正确添加插件,因为它没有引发任何错误,但也没有在表格上创建过滤器/搜索字段。
数据表行由服务器端创建,第一列包含复选框。您可以在下面找到我的 html 和 jquery。
可能是什么问题?
<table id="orderList">
<thead>
<tr>
<th><input type=checkbox name='allSelect' class="allSelect"></th>
<th> h1 </th>
<th> h2 </th>
<th> h3 </th>
<th> h4 </th>
<th> h5 </th>
</tr>
</thead>
</table>
var oTable = $('#orderList').dataTable(
{
"sScrollY": "350px",
"sScrollX": "100%",
"bJQueryUI": true,
"sPaginationType": "full_numbers",
"bProcessing": true,
"bServerSide": true,
"sAjaxSource": "/project/order_search_ajax/",
"aoColumnDefs": [
{ 'bSortable': false, 'aTargets': [ 0 ] }
]
}
).columnFilter();
最佳答案
操作。我必须按照文档中的说明添加页脚
<table id="orderList">
<thead>
<tr>
<th><input type=checkbox name='allSelect' class="allSelect"></th>
<th> h1 </th>
<th> h2 </th>
<th> h3 </th>
<th> h4 </th>
<th> h5 </th>
</tr>
</thead>
<tfoot>
<tr>
<th>Rendering engine</th>
<th>Rendering engine</th>
<th>Browser</th>
<th>Platform(s)</th>
<th>Engine version</th>
<th>CSS grade</th>
</tr>
</tfoot>
</table>
关于jquery 数据表单个列过滤器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11152102/