如何在数据表标题之后放置数据表列过滤器

how to place datatable column filter on after datatable title

我想根据在文本字段中的写入过滤第 3 列字段。但它不起作用。而且我还想在 table head.

之后列过滤文本字段

JS

<script type="text/javascript" src="assets/admin/js/jquery.validate.js"></script>
<script type="text/javascript" src="assets/admin/js/jquery.dataTables.js"></script>
<script type="text/javascript" src="assets/admin/js/jquery.datatables.columnfilter.js"></script>

JS

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

$('#example').dataTable( {

"bProcessing": true,

"bFilter" : true,

//"bServerSide": true,

"aaSorting": [[0,'desc']],

"aoColumns":[{ "bVisible":false, "bSearchable": false, "bSortable": false},

{ "bVisible":true,"bSearchable": true, "bSortable": true , "mRender": rendercheckbox},

{ "bVisible":true,"bSearchable": true, "bSortable": true , "mRender": renderucwords},

{ "bVisible":true,"bSearchable": true, "bSortable": false , "mRender": renderattachment, "sClass": "center"},

{ "bVisible":true, "bSearchable": false, "bSortable": false ,"mRender": renderaction , "sClass": "center"}],

"bJQueryUI": true,

"sPaginationType": "full_numbers",

"sScrollX": "100%",

"sScrollXInner": "100%",

"bScrollCollapse": true,

"sAjaxSource":"<?php echo site_url('admins/promotion/getdata');?>"

} ).

columnFilter({

sPlaceHolder: "head:before",

bFilter: false,

aoColumns: [  null,

null,

{ type: "text",                         

},

null,

null

] 

});

});

</script>

使用

$('#example').DataTable( {});

而不是

$('#example').dataTable( {});

同时检查控制台中是否有任何 javascript 错误