2016-10-25 5 views
1

ことでDataTableを設定したため、私が定義され、このデータテーブルを持っていますが、デフォルトでは、最初の列が発注し、私はそれはあなたが「順序」を指定する必要が二列ではJQuery /特定の列で

$(document).ready(function(){ 
       $('[data-toggle="tooltip"]').tooltip(); 
       var table = $('#producersTableId').DataTable({ 
        "dom": '<"top">rt<"bottom"lp><"clear">', 
        "autoWidth": false, 
        "columnDefs": [ 
         {"targets": [0], "width": '20%'}, 
         {"targets": [1], "width": '20%'}, 
         {"targets": [2], "width": '35%'}, 
         {"targets": [3], "width": '15%'}, 

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

答えて