jquery 数据表单个列过滤器

标签 jquery datatable

我尝试使用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/

相关文章:

javascript - 开始在文本框中输入时的 Jquery 文本

javascript - jQuery 库代码

c# - 集合被修改;枚举操作可能不会在 Except 操作上执行

javascript - 如何使用 jquery 动态更改数据表?

ruby-on-rails - 从 github 上拉下来,无法在本地使用 postgreSQL

javascript - 在 dataTable 的单列中搜索多个值(可能使用数组?)

javascript点击下拉菜单事件

javascript - Mozilla FireFox 悬停的工作方式与 Chrome 不同

javascript - 使用response.sendfile()找不到错误404文件?

javascript - 没有插件的 jquery 排序表