我想从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>