search() for individual column is not working

search() for individual column is not working

markvjmarkvj Posts: 1Questions: 0Answers: 0
edited January 2019 in Free community support
$('#purchase_data tfoot th').each( function () {
var title = $(this).text();
$(this).html( '<input type="text" placeholder="Search '+title+'" />' );
} );
var purchasedataTable = $('#purchase_data').DataTable();
processeddata.columns().every( function ( colIdx ) {
$( 'input', processeddata.column( colIdx ).footer() ).on( 'keyup change', function () {
// alert(colIdx.value);
processeddata.column(colIdx).search( this.value ).draw();
} );
} );

kindly can any one tell, whats wrong in above code, because when i'm searching for some data in column, its not displayed matched records.

Replies

  • colincolin Posts: 15,240Questions: 1Answers: 2,599

    Hi @markvj ,

    There's not much to go on there. Hopefully this working example will help.

    If not, we're happy to take a look, but as per the forum rules, please link to a test case - a test case that replicates the issue will ensure you'll get a quick and accurate response. Information on how to create a test case (if you aren't able to link to the page you are working on) is available here.

    Cheers,

    Colin

This discussion has been closed.