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

问题描述 投票:1回答:2

我想根据文本字段中的写入内容过滤第3列字段。但是它不起作用。而且我还想在表头之后对字段进行过滤。

<< img src =“ https://image.soinside.com/eyJ1cmwiOiAiaHR0cHM6Ly9pLnN0YWNrLmltZ3VyLmNvbS9QMnprSS5wbmcifQ==” alt =“在此处输入图像描述”>“ >>

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>

我想根据文本字段中的写入内容过滤第3列字段。但是它不起作用。而且我还想在表头之后对字段进行过滤。 JS

codeigniter jquery-datatables jquery-datatables-editor
2个回答
1
投票

使用


0
投票

简单尝试一下

© www.soinside.com 2019 - 2024. All rights reserved.