Server Side table: column search only some fields

Server Side table: column search only some fields

pettedemonpettedemon Posts: 38Questions: 6Answers: 0

Hi,
I have a server-side table

load the table

`var table = $('#canzoni_player').DataTable( {
"processing": true,
"serverSide": true,
"autoWidth": false,

    "ajax": "scripts/tabella_playlist.php",
        "lengthMenu": [[50,100, 250, 500, -1], [50,100, 250, 500, "Tutti"]],
    "language": {
        "url": "//cdn.datatables.net/plug-ins/9dcbecd42ad/i18n/Italian.json"
    },`

load the search box for every columns
`
$('#canzoni_player tfoot th').each( function () {
var title = $(this).text();
$(this).html( '<input type="text" placeholder="Search '+title+'" />' );
} )

initComplete: function() {
  var api = this.api();

  // Apply the search
  api.columns().every(function() {
    var that = this;

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

;`

This is the html Code
` <tfoot>
<tr>
<th>Autore</th>
<th>Titolo</th>
<th>Seleziona</th>
<th>BPM</th>
<th>Anno</th>
<th>Player</th>

                </tr>
            </tfoot>`

But I want only some columns with the search box...
So it is possible?
thanks

Answers

This discussion has been closed.