None of the previous answers solved the problem for me.
The solution I found was using table.api().column(colIdx)
instead of table.column(colIdx)
.
Working example I developed for a table with names and ages:
table = jQuery('#sel').dataTable( {
"initComplete": function( settings, json ) {
jQuery("#sel_filter").find("input").unbind();
jQuery("#sel_filter").find("label").after(
"");
jQuery("#sel_filter").find("input").on('keyup change', function(){
table.api().columns( jQuery("#opts").val()).search( this.value ).draw();
});
},
"ajax": {
"url": "urlvalue",
"type": "GET"
},
"columns": [
{ "data": "name" },
{ "data": "age" }
]
});
Hope it helps.