2016-04-11 36 views

cevap

1

Bkz. Live DOM ordering örnek.

/* Create an array with the values of all the checkboxes in a column */ 
$.fn.dataTable.ext.order['dom-checkbox'] = function (settings, col) 
{ 
    return this.api().column(col, {order:'index'}).nodes().map(function (td, i) { 
     return $('input', td).prop('checked') ? '1' : '0'; 
    }); 
} 

/* Initialise the table with the required column ordering data types */ 
$(document).ready(function() { 
    $('#example').DataTable({ 
     "columns": [ 
      { "orderDataType": "dom-checkbox" } 
     ] 
    }); 
});