Thanks to Stryner for his code How to disable a search/filter on a specific column on a datatable?
which is exactly what I was looking for.
BUT, if bottom TH cells do display the inputs where needed, on blur/change/keyup, nothing happends...
Console : Undefined is not a function - corresponding to " oTable.columns().eq( 0 ).each( function ( colIdx ) {"
Can you help me to solve this, please ?
Thank u :))
$('#datos tfoot th').not(":eq(0),:eq(3),:eq(5),:eq(6)") //Exclude columns 0, 3, 5 and 6
.each( function ()
{
var title = $('#example thead th').eq( $(this).index() ).text();
$(this).html( '<input type="text" placeholder="Rechercher" />' );
});
var oTable = $('#datos').dataTable();
oTable.columns().eq( 0 ).each( function ( colIdx ) {
if (colIdx == 0 || colIdx == 3 || colIdx == 5 || colIdx == 6) return; //Do not add event handlers for these columns
$( 'input', table.column( colIdx ).footer() ).on( 'keyup blur change', function () { oTable
.column( colIdx )
.search( this.value )
.draw();
});
});
My server-side script is the same as this one at the bottom of the page daniweb.com/web-development/php/threads/467455/convert-datatables-to-server-side-processing
Thanks