jQuery - DataTables - ColumnFilter不起作用

时间:2013-04-11 17:47:42

标签: jquery datatables

我正在使用DataTables(成功)并尝试合并ColumnFilter。我的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]
    });
});

我的表格页眉和页脚如下所示:

<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>

我在Chrome中没有收到任何错误。生成的数据表看起来应该完全正确,除了它没有过滤器列。查看生成的源代码,可以下载用于列过滤器的JS。有人可以帮忙吗?

1 个答案:

答案 0 :(得分:3)

评论提升回答:

我不是数据表专家,但这行可以与它有关吗? "bFilter": false,