Individual column filter not working
Individual column filter not working
sarveshvemana
Posts: 4Questions: 0Answers: 0
Hi, I'm trying to implement individual column filter but it is showing error as
[code]
TypeError: $(...).dataTable(...).columnFilter is not a function
$('#jQueryInvoices').dataTable().columnFilter();
[/code]
My sample code is :
I tried it in two ways , first is
[code]
$(document).ready(function() {
$('#jQueryInvoices').dataTable().columnFilter();
});
[/code]
and second is
[code]
$("#jQueryInvoices").dataTable({
"bServerSide": false,
"sAjaxSource":ajaxUrl,
"sAjaxDataProp": "ResultSet.aaData",
"bProcessing": true,
"sPaginationType": "full_numbers",
"bJQueryUI": true,
"bDestroy": true,
"sEcho": 1,
"iTotalRecords": 1,
"iTotalDisplayRecords": 10,
"aoColumns": [
{ "mDataProp": "controlNumber",sDefaultContent: "" },
{ "mDataProp": "runNumber",sDefaultContent: "" },
{ "mDataProp": "invoiceNumber" },
{ "mDataProp": "status" },
{ "mDataProp": "invoiceAmount" }
]
}).columnFilter();
[/code]
And included
Shall i mention any table footer?? I'm using data table 1.9 version. Please tell me the solution where i'm missing
[code]
TypeError: $(...).dataTable(...).columnFilter is not a function
$('#jQueryInvoices').dataTable().columnFilter();
[/code]
My sample code is :
I tried it in two ways , first is
[code]
$(document).ready(function() {
$('#jQueryInvoices').dataTable().columnFilter();
});
[/code]
and second is
[code]
$("#jQueryInvoices").dataTable({
"bServerSide": false,
"sAjaxSource":ajaxUrl,
"sAjaxDataProp": "ResultSet.aaData",
"bProcessing": true,
"sPaginationType": "full_numbers",
"bJQueryUI": true,
"bDestroy": true,
"sEcho": 1,
"iTotalRecords": 1,
"iTotalDisplayRecords": 10,
"aoColumns": [
{ "mDataProp": "controlNumber",sDefaultContent: "" },
{ "mDataProp": "runNumber",sDefaultContent: "" },
{ "mDataProp": "invoiceNumber" },
{ "mDataProp": "status" },
{ "mDataProp": "invoiceAmount" }
]
}).columnFilter();
[/code]
And included
Shall i mention any table footer?? I'm using data table 1.9 version. Please tell me the solution where i'm missing
This discussion has been closed.
Replies
"sDom": 'W<"clear">lfrtip'
Use this Code Works Fine
$(document).ready(function () { $('#myDataTable tfoot th').each(function () { var title = $('#myDataTable thead th').eq($(this).index()).text(); $(this).html(''); }); var table = $('#myDataTable').dataTable().columnFilter(); $("#myDataTable tfoot input").on('keyup change', function () { table.column($(this.value).parent().index() + ':visible') .filter(this.value) .draw(); }); });