How to place the Individual column searching (text inputs) on thead

How to place the Individual column searching (text inputs) on thead

StefanLamStefanLam Posts: 1Questions: 1Answers: 0
edited March 2021 in Free community support

When I change the text input searching to thead, the searching function was not working
How to place on thead with searching function?

// DataTable
var table = $('#arptable').DataTable({
 "order": [],
 "lengthMenu": [ 25, 50, 100, 200 ],
 "dom": "<'row'<'col-sm-12 col-md-6'l><'col-sm-12 col-md-6'f><'col-sm-12 col-md-6'i><'col-sm-12 col-md-6'p>>rt<'row'<'col-sm-12 col-md-6'l><'col-sm-12 col-md-6'p>>",
    initComplete: function () {
        // Apply the search
        this.api().columns().every( function () {
            var that = this;

            $( 'input', this.footer() ).on( 'keyup change clear', function () {
                if ( that.search() !== this.value ) {
                    that
                        .search( this.value )
                        .draw();
                }
            } );
        } );
    }
});

Answers

This discussion has been closed.