How to overwrite the search api for datatable?

How to overwrite the search api for datatable?

senjujosesenjujose Posts: 8Questions: 4Answers: 0
edited August 2019 in Free community support

I have requirement to exclude the span class inside the td from the search.

This question has an accepted answers - jump to answer

Answers

  • colincolin Posts: 15,142Questions: 1Answers: 2,586
    Answer ✓

    Hi @senjujose ,

    To do that, you would need to create a custom search. Here is the documentation, and here are a few examples,

    Cheers,

    Colin

  • senjujosesenjujose Posts: 8Questions: 4Answers: 0
    edited August 2019

    Thanks Colin, Below is my code. So can you please tell me how to include the custom search to filter the span class inside the td. It will be very helpful if you could send me a sample code

        table.columns().eq(0).each(function (colIdx) {
    
            $('input', table.column(colIdx).footer()).on('keyup change', function () {
    
    
                table.column(colIdx)
                    .search(this.value)
                    .draw();
            });
        });  
    
This discussion has been closed.