search every colomn
search every colomn
bighero6
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();
}
} );
} );
} );`
This discussion has been closed.
Answers
What do you mean? What happens? What messages are generated, if any?