codeigniterdatatablesjquery-datatables-editor

how to place datatable column filter on after datatable title


I want to filter 3rd column field as per write in text field. But its not work. And i also want to column filter textfield after table head.

enter image description here

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>

Solution

  • Use

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

    Instead of

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

    Also check for any javascript error in console