search every colomn

search every colomn

bighero6bighero6 Posts: 1Questions: 1Answers: 0

I write with server side but it doesn't work. please advises.

`$(document).ready(function() {
// Setup - add a text input to each footer cell
$('#users tfoot th').each( function () {
var title = $(this).text();
$(this).html( '<input type="text" placeholder="Search '+title+'" />' );
} );

// DataTable
var table = $('#users').DataTable({
        "columns": [
            {"data": "time on"},
            {"data": "time off"},
            {"data": "status"}
        ],
        "processing": true,
        "serverSide": true,
        "ajax": {
            url: 'demo2.php',
            type: 'POST'
        }
    });

// Apply the search
table.columns().every( function () {
    var that = this;
     $( 'input', this.footer() ).on( 'keyup change', function () {
        if ( that.search() !== this.value ) {
            that
                .search( this.value )
                .draw();
        }
    } );
} );

} );`

Answers

  • tangerinetangerine Posts: 3,365Questions: 39Answers: 395

    ....but it doesn't work.

    What do you mean? What happens? What messages are generated, if any?

This discussion has been closed.