lundi 18 juillet 2016

How to filter based on checkbox with datatables?

I have a table based on datatables that is filled from a mysql database... I want to filter thorugh a button, only row selected that have a checkbox on first column

This is my example

http://ift.tt/2a6PENx

$(document).ready(function() {
    $('#example').DataTable();
} );

var buttons = new $.fn.dataTable.Buttons(example, {
  "buttons": [{
    "extend": 'copyHtml5',
  }, {
    "extend": 'print',
  }, {
    "text": '<i class="fa fa-filter"></i> Filter checkbox',
    "action": function ( e, dt, node, config ) {
      table.ajax.reload();
    },
    className: 'bg-yellow-active'
  }
             ]        
}).container().appendTo($('#panel-heading'));     

I can filter sending a new request to mysql database but if possibile is better with a script request... How can do this?




Aucun commentaire:

Enregistrer un commentaire