我得到这个$(...)。dataTable(...)。columnFilter不是一个函数

时间:2015-07-05 18:08:25

标签: jquery datatable

我想从this question开始,我正在使用正确的构造函数。

运行代码时出现此错误:

  

$(...)。dataTable(...)。columnFilter不是函数

HTML:

<table class="table table-striped" id="activeProjects">
    <thead>
        <tr>
            <th>Project Name</th>
            <th>Project Number</th>
            <th>Manager</th>
            <th>Architect</th>
        </tr>
    </thead>
    <tbody>

    </tbody>
    <tfoot>
        <tr>
            <th></th>
            <th></th>
            <th></th>
            <th></th>
        </tr>
    </tfoot>
</table>

<script>
    $(document).ready(function () {

        var table =  $('#activeProjects').dataTable({
            "processing": true,
            "serverSide": true,
            "ajax": {
                "url": "../api/Project/GetAll/",
                "dataSrc": ""
            },

            "columns": [
                { "data": "ProjectName" },
                { "data": "ProjectNumber" },
                { "data": "ProjectManager" },
                { "data": "ProjectArchitect" }
            ]
        }).columnFilter({
            aoColumns: [ { type: "text" },
                         { type: "text" },
                         { type: "text" },
                         { type: "text" }
            ]

        });
    });
</script>

0 个答案:

没有答案