简体   繁体   English

jQuery - DataTables - ColumnFilter不起作用

[英]jQuery - DataTables - ColumnFilter Doesn't Work

I'm using DataTables (successfully) and am trying to incorporate ColumnFilter. 我正在使用DataTables(成功)并尝试合并ColumnFilter。 My JS looks as follows: 我的JS看起来如下:

$(document).ready(function () {
    oTable = $('#ecTable').dataTable({
        "sScrollY": "550px",
        "sScrollX": "100%",
        "bPaginate": false,
        "bScrollCollapse": true,
        "bInfo": true,
        "bFilter": false,
        "bProcessing": true,
        "aaSorting": [[0, 'desc']]
    })

    .columnFilter({
        aoColumns: [
            null,
            null,
            { type: "select" },
            { type: "select" },
            null,
            null,
            null,
            null,
            null,
            null,
            null,
            null,
            null,
            null]
    });
});

My table header and footer looks like this: 我的表格页眉和页脚看起来像这样:

<thead>
    <tr>
        <th>Listing Date</th>
        <th>Expiration Date</th>
        <th>Manufacturer</th>
        <th>Model</th>
        <th>Body Style</th>
        <th>Engine</th>
        <th>Year</th>
        <th>Mileage</th>
        <th>Ext. Color</th>
        <th>Int. Color</th>
        <th>Listing Price</th>
        <th>Comments</th>
        <th>Number Of Views</th>
        <th class="noSort">Navigation</th>
    </tr>
</thead>

   <tfoot>
        <tr>
            <th>Listing Date</th>
            <th>Expiration Date</th>
            <th>Manufacturer</th>
            <th>Model</th>
            <th>Body Style</th>
            <th>Engine</th>
            <th>Year</th>
            <th>Mileage</th>
            <th>Ext. Color</th>
            <th>Int. Color</th>
            <th>Listing Price</th>
            <th>Comments</th>
            <th>Number Of Views</th>
            <th></th>
        </tr>
    </tfoot>

I'm not getting any errors in Chrome. 我在Chrome中没有收到任何错误。 The resulting data table looks exactly as it should, except it has no filter columns. 生成的数据表看起来应该完全正确,除了它没有过滤器列。 Looking at the generated source, the JS for column filter is getting downloaded. 查看生成的源代码,可以下载用于列过滤器的JS。 Can anyone help? 有人可以帮忙吗?

Comment promoted to answer: 评论提升回答:

I'm no datatables expert, but could this line have something to do with it? 我不是数据表专家,但这行可以与它有关吗? "bFilter": false,

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM